diff --git a/swaggerci/storSimple1200Series/.gitattributes b/swaggerci/storSimple1200Series/.gitattributes new file mode 100644 index 000000000000..2125666142eb --- /dev/null +++ b/swaggerci/storSimple1200Series/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/.gitignore b/swaggerci/storSimple1200Series/.gitignore new file mode 100644 index 000000000000..7998f37e1e47 --- /dev/null +++ b/swaggerci/storSimple1200Series/.gitignore @@ -0,0 +1,5 @@ +bin +obj +.vs +tools +test/*-TestResults.xml \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/Az.StorSimple.csproj b/swaggerci/storSimple1200Series/Az.StorSimple.csproj new file mode 100644 index 000000000000..074166c367b3 --- /dev/null +++ b/swaggerci/storSimple1200Series/Az.StorSimple.csproj @@ -0,0 +1,44 @@ + + + + 0.1.0 + 7.1 + netstandard2.0 + Library + Az.StorSimple.private + Microsoft.Azure.PowerShell.Cmdlets.StorSimple + true + false + ./bin + $(OutputPath) + Az.StorSimple.nuspec + true + + + 1998, 1591 + true + + + + + false + TRACE;DEBUG;NETSTANDARD + + + + true + true + MSSharedLibKey.snk + TRACE;RELEASE;NETSTANDARD;SIGN + + + + + + + + + $(DefaultItemExcludes);resources/** + + + \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/Az.StorSimple.format.ps1xml b/swaggerci/storSimple1200Series/Az.StorSimple.format.ps1xml new file mode 100644 index 000000000000..1ffebb58d933 --- /dev/null +++ b/swaggerci/storSimple1200Series/Az.StorSimple.format.ps1xml @@ -0,0 +1,3547 @@ + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.StorSimpleIdentity + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.StorSimpleIdentity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccessControlRecordName + + + BackupName + + + CertificateName + + + ChapUserName + + + CredentialName + + + DeviceName + + + DiskName + + + ElementName + + + FileServerName + + + Id + + + IscsiServerName + + + JobName + + + ManagerName + + + ResourceGroupName + + + ScheduleGroupName + + + ShareName + + + StorageDomainName + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecord + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecord + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecordProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecordProperties + + + + + + + + + + + + InitiatorName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Alert + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Alert + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertErrorDetails + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertErrorDetails + + + + + + + + + + + + + + + + + + ErrorCode + + + ErrorMessage + + + Occurence + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertFilter + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertFilter + + + + + + + + + + + + + + + + + + + + + + + + AppearedOnTime + + + Severity + + + SourceName + + + SourceType + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertList + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AlertType + + + AppearedAtSourceTime + + + AppearedAtTime + + + ClearedAtSourceTime + + + ClearedAtTime + + + Recommendation + + + ResolutionReason + + + Scope + + + Severity + + + Status + + + Title + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertPropertiesDetailedInformation + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertPropertiesDetailedInformation + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSettings + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSettings + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSettingsProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSettingsProperties + + + + + + + + + + + + + + + + + + + + + AdditionalRecipientEmailList + + + AlertNotificationCulture + + + EmailNotification + + + NotificationToServiceOwner + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSource + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSource + + + + + + + + + + + + + + + + + + Name + + + TimeZone + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret + + + + + + + + + + + + + + + + + + EncryptionAlgorithm + + + EncryptionCertificateThumbprint + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperation + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperation + + + + + + + + + + + + + + + Name + + + Origin + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperationDisplay + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperationDisplay + + + + + + + + + + + + + + + + + + + + + Description + + + Operation + + + Provider + + + Resource + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperations + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperations + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Backup + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Backup + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElement + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElement + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElementProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElementProperties + + + + + + + + + + + + + + + + + + DataPolicy + + + EndpointName + + + SizeInByte + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupFilter + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupFilter + + + + + + + + + + + + + + + CreatedTime + + + InitiatedBy + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupList + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CreatedTime + + + DeviceId + + + ExpirationTime + + + InitiatedBy + + + SizeInByte + + + TargetId + + + TargetType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroup + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroup + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapSettings + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapSettings + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ClearAlertRequest + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ClearAlertRequest + + + + + + + + + + + + + + + Alert + + + ResolutionMessage + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.CloneRequestProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.CloneRequestProperties + + + + + + + + + + + + + + + + + + NewEndpointName + + + TargetAccessPointId + + + TargetDeviceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Device + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Device + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceDetails + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AvailableLocalStorageInByte + + + AvailableStorageInByte + + + EndpointCount + + + ProvisionedLocalStorageInByte + + + ProvisionedStorageInByte + + + TotalBackupSizeInByte + + + TotalLocalStorageInByte + + + TotalStorageInByte + + + UsingLocalStorageInByte + + + UsingStorageInByte + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DevicePatch + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DevicePatch + + + + + + + + + + + + DeviceDescription + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ActivationTime + + + AllowedDeviceOperation + + + Culture + + + DeviceCapability + + + DeviceConfigurationStatus + + + DeviceDescription + + + DeviceSoftwareVersion + + + DomainName + + + FriendlySoftwareName + + + ModelDescription + + + Status + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.EncryptionSettings + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.EncryptionSettings + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.EncryptionSettingsProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.EncryptionSettingsProperties + + + + + + + + + + + + + + + EncryptionStatus + + + KeyRolloverStatus + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error + + + + + + + + + + + + Code + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FailoverRequest + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FailoverRequest + + + + + + + + + + + + + + + + + + + + + AccesspointId + + + KeepSourceDevice + + + SkipValidation + + + TargetDeviceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServer + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServer + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServerProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServerProperties + + + + + + + + + + + + + + + + + + + + + BackupScheduleGroupId + + + Description + + + DomainName + + + StorageDomainId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShare + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShare + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShareProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShareProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AdminUser + + + DataPolicy + + + Description + + + LocalUsedCapacityInByte + + + MonitoringStatus + + + ProvisionedCapacityInByte + + + ShareStatus + + + UsedCapacityInByte + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IPConfig + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IPConfig + + + + + + + + + + + + + + + + + + Gateway + + + IPAddress + + + PrefixLength + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDisk + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDisk + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccessControlRecord + + + DataPolicy + + + Description + + + DiskStatus + + + LocalUsedCapacityInByte + + + MonitoringStatus + + + ProvisionedCapacityInByte + + + UsedCapacityInByte + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServer + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServer + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServerProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServerProperties + + + + + + + + + + + + + + + + + + + + + + + + BackupScheduleGroupId + + + ChapId + + + Description + + + ReverseChapId + + + StorageDomainId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Item + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Item + + + + + + + + + + + + + + + Key + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Job + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Job + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + EndTime + + + PercentComplete + + + StartTime + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorDetails + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorDetails + + + + + + + + + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorItem + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorItem + + + + + + + + + + + + + + + + + + Code + + + Message + + + Recommendation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobFilter + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobFilter + + + + + + + + + + + + + + + + + + JobType + + + StartTime + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobList + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackupPointInTime + + + DeviceId + + + EntityId + + + EntityType + + + IsCancellable + + + JobType + + + SourceDeviceId + + + TargetId + + + TargetType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStage + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStage + + + + + + + + + + + + + + + + + + + + + Detail + + + ErrorCode + + + Message + + + StageStatus + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStats + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStats + + + + + + + + + + + + + + + + + + CompletedWorkItemCount + + + EstimatedTimeRemaining + + + TotalWorkItemCount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Manager + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Manager + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + Type + + + Etag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfo + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfo + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + Etag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfoProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfoProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + Algorithm + + + EncryptionKey + + + EncryptionKeyThumbprint + + + IntegrityKey + + + PortalCertificateThumbprint + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerIntrinsicSettings + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerIntrinsicSettings + + + + + + + + + + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerPatchTags + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerPatchTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerProperties + + + + + + + + + + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerSku + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerSku + + + + + + + + + + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Message + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Message + + + + + + + + + + + + + + + Language + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricAvailablity + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricAvailablity + + + + + + + + + + + + + + + Retention + + + TimeGrain + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricData + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricData + + + + + + + + + + + + + + + + + + + + + + + + + + + Average + + + Count + + + Maximum + + + Minimum + + + Sum + + + TimeStamp + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDefinition + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDefinition + + + + + + + + + + + + + + + + + + + + + PrimaryAggregationType + + + ResourceId + + + Type + + + Unit + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDimension + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDimension + + + + + + + + + + + + + + + Name + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricFilter + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricFilter + + + + + + + + + + + + + + + + + + EndTime + + + StartTime + + + TimeGrain + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricName + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricName + + + + + + + + + + + + + + + LocalizedValue + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricNameFilter + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricNameFilter + + + + + + + + + + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Metrics + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Metrics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EndTime + + + PrimaryAggregation + + + ResourceId + + + StartTime + + + TimeGrain + + + Type + + + Unit + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkAdapter + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkAdapter + + + + + + + + + + + + + + + + + + DhcpStatus + + + LinkSpeed + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkSettings + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkSettings + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkSettingsProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkSettingsProperties + + + + + + + + + + + + + + + PrimaryDnsServer + + + SecondaryDnsServer + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.RawCertificateData + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.RawCertificateData + + + + + + + + + + + + + + + AuthType + + + Certificate + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Resource + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Resource + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceCertificateAndAadDetails + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceCertificateAndAadDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AadAuthority + + + AadTenantId + + + AuthType + + + AzureManagementEndpointAudience + + + Certificate + + + FriendlyName + + + Issuer + + + ResourceId + + + ServicePrincipalClientId + + + ServicePrincipalObjectId + + + Subject + + + Thumbprint + + + ValidFrom + + + ValidTo + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceTags + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SecuritySettings + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SecuritySettings + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SendTestAlertEmailRequest + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SendTestAlertEmailRequest + + + + + + + + + + + + EmailList + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredential + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredential + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredentialProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredentialProperties + + + + + + + + + + + + + + + + + + + + + + + + CloudType + + + EnableSsl + + + EndPoint + + + Location + + + Login + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomain + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomain + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomainProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomainProperties + + + + + + + + + + + + + + + EncryptionStatus + + + StorageAccountCredentialId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SymmetricEncryptedSecret + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SymmetricEncryptedSecret + + + + + + + + + + + + + + + + + + EncryptionAlgorithm + + + Value + + + ValueCertificateThumbprint + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Time + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Time + + + + + + + + + + + + + + + Hour + + + Minute + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeSettings + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeSettings + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeSettingsProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeSettingsProperties + + + + + + + + + + + + + + + + + + PrimaryTimeServer + + + SecondaryTimeServer + + + TimeZone + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateDownloadProgress + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateDownloadProgress + + + + + + + + + + + + + + + + + + + + + + + + + + + DownloadPhase + + + NumberOfUpdatesDownloaded + + + NumberOfUpdatesToDownload + + + PercentComplete + + + TotalBytesDownloaded + + + TotalBytesToDownload + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateInstallProgress + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateInstallProgress + + + + + + + + + + + + + + + + + + NumberOfUpdatesInstalled + + + NumberOfUpdatesToInstall + + + PercentComplete + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Updates + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Updates + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdatesProperties + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdatesProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DeviceLastScannedTime + + + DeviceVersion + + + InProgressDownloadJobId + + + InProgressDownloadJobStartedTime + + + InProgressInstallJobId + + + InProgressInstallJobStartedTime + + + InProgressScanStartedTime + + + LastCompletedDownloadJobTime + + + LastCompletedInstallJobTime + + + LastCompletedScanTime + + + RebootRequiredForInstall + + + RegularUpdatesAvailable + + + Status + + + TotalItemsPendingForDownload + + + TotalItemsPendingForInstall + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UploadCertificateRequest + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UploadCertificateRequest + + + + + + + + + + + + ContractVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UploadCertificateResponse + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UploadCertificateResponse + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/Az.StorSimple.nuspec b/swaggerci/storSimple1200Series/Az.StorSimple.nuspec new file mode 100644 index 000000000000..eac75b1a0537 --- /dev/null +++ b/swaggerci/storSimple1200Series/Az.StorSimple.nuspec @@ -0,0 +1,32 @@ + + + + Az.StorSimple + 0.1.0 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell: $(service-name) cmdlets + + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM PSModule $(service-name) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/Az.StorSimple.psd1 b/swaggerci/storSimple1200Series/Az.StorSimple.psd1 new file mode 100644 index 000000000000..2185898fa724 --- /dev/null +++ b/swaggerci/storSimple1200Series/Az.StorSimple.psd1 @@ -0,0 +1,24 @@ +@{ + GUID = '0a430783-990a-47b9-bb3a-1a74838ee9cf' + RootModule = './Az.StorSimple.psm1' + ModuleVersion = '0.1.0' + CompatiblePSEditions = 'Core', 'Desktop' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = 'Microsoft Corporation. All rights reserved.' + Description = 'Microsoft Azure PowerShell: StorSimple cmdlets' + PowerShellVersion = '5.1' + DotNetFrameworkVersion = '4.7.2' + RequiredAssemblies = './bin/Az.StorSimple.private.dll' + FormatsToProcess = './Az.StorSimple.format.ps1xml' + FunctionsToExport = 'Backup-AzStorSimpleFileServerNow', 'Backup-AzStorSimpleIscsiServerNow', 'Clear-AzStorSimpleAlert', 'Copy-AzStorSimpleBackup', 'Get-AzStorSimpleAccessControlRecord', 'Get-AzStorSimpleAlert', 'Get-AzStorSimpleAvailableProviderOperation', 'Get-AzStorSimpleBackup', 'Get-AzStorSimpleBackupScheduleGroup', 'Get-AzStorSimpleChapSetting', 'Get-AzStorSimpleDevice', 'Get-AzStorSimpleDeviceAlertSetting', 'Get-AzStorSimpleDeviceFailoverTarget', 'Get-AzStorSimpleDeviceMetric', 'Get-AzStorSimpleDeviceMetricDefinition', 'Get-AzStorSimpleDeviceNetworkSetting', 'Get-AzStorSimpleDeviceTimeSetting', 'Get-AzStorSimpleDeviceUpdateSummary', 'Get-AzStorSimpleFileServer', 'Get-AzStorSimpleFileServerMetric', 'Get-AzStorSimpleFileServerMetricDefinition', 'Get-AzStorSimpleFileShare', 'Get-AzStorSimpleFileShareMetric', 'Get-AzStorSimpleFileShareMetricDefinition', 'Get-AzStorSimpleIscsiDisk', 'Get-AzStorSimpleIscsiDiskMetric', 'Get-AzStorSimpleIscsiDiskMetricDefinition', 'Get-AzStorSimpleIscsiServer', 'Get-AzStorSimpleIscsiServerMetric', 'Get-AzStorSimpleIscsiServerMetricDefinition', 'Get-AzStorSimpleJob', 'Get-AzStorSimpleManager', 'Get-AzStorSimpleManagerEncryptionKey', 'Get-AzStorSimpleManagerEncryptionSetting', 'Get-AzStorSimpleManagerExtendedInfo', 'Get-AzStorSimpleManagerMetric', 'Get-AzStorSimpleManagerMetricDefinition', 'Get-AzStorSimpleStorageAccountCredentials', 'Get-AzStorSimpleStorageDomain', 'Install-AzStorSimpleDeviceUpdate', 'Invoke-AzStorSimpleDeactivateDevice', 'Invoke-AzStorSimpleDownloadDeviceUpdate', 'Invoke-AzStorSimpleScanDevice', 'Invoke-AzStorSimpleUploadManagerRegistrationCertificate', 'New-AzStorSimpleAccessControlRecord', 'New-AzStorSimpleBackupScheduleGroup', 'New-AzStorSimpleChapSetting', 'New-AzStorSimpleDeviceAlertSetting', 'New-AzStorSimpleDeviceSecuritySetting', 'New-AzStorSimpleFileServer', 'New-AzStorSimpleFileShare', 'New-AzStorSimpleIscsiDisk', 'New-AzStorSimpleIscsiServer', 'New-AzStorSimpleManager', 'New-AzStorSimpleManagerExtendedInfo', 'New-AzStorSimpleStorageAccountCredentials', 'New-AzStorSimpleStorageDomain', 'Remove-AzStorSimpleAccessControlRecord', 'Remove-AzStorSimpleBackup', 'Remove-AzStorSimpleBackupScheduleGroup', 'Remove-AzStorSimpleChapSetting', 'Remove-AzStorSimpleDevice', 'Remove-AzStorSimpleFileServer', 'Remove-AzStorSimpleFileShare', 'Remove-AzStorSimpleIscsiDisk', 'Remove-AzStorSimpleIscsiServer', 'Remove-AzStorSimpleManager', 'Remove-AzStorSimpleManagerExtendedInfo', 'Remove-AzStorSimpleStorageAccountCredentials', 'Remove-AzStorSimpleStorageDomain', 'Send-AzStorSimpleAlertTestEmail', 'Update-AzStorSimpleDevice', 'Update-AzStorSimpleDeviceSecuritySetting', 'Update-AzStorSimpleManager', 'Update-AzStorSimpleManagerExtendedInfo', '*' + AliasesToExport = '*' + PrivateData = @{ + PSData = @{ + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'StorSimple' + LicenseUri = 'https://aka.ms/azps-license' + ProjectUri = 'https://github.com/Azure/azure-powershell' + ReleaseNotes = '' + } + } +} diff --git a/swaggerci/storSimple1200Series/Az.StorSimple.psm1 b/swaggerci/storSimple1200Series/Az.StorSimple.psm1 new file mode 100644 index 000000000000..883236853ffa --- /dev/null +++ b/swaggerci/storSimple1200Series/Az.StorSimple.psm1 @@ -0,0 +1,107 @@ +# region Generated + # ---------------------------------------------------------------------------------- + # Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. + # ---------------------------------------------------------------------------------- + # Load required Az.Accounts module + $accountsName = 'Az.Accounts' + $accountsModule = Get-Module -Name $accountsName + if(-not $accountsModule) { + $localAccountsPath = Join-Path $PSScriptRoot 'generated/modules' + if(Test-Path -Path $localAccountsPath) { + $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1 + if($localAccounts) { + $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru + } + } + if(-not $accountsModule) { + $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0 + if($hasAdequateVersion) { + $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru + } + } + } + + if(-not $accountsModule) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop + } elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop + } + Write-Information "Loaded Module '$($accountsModule.Name)'" + + # Load the private module dll + $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.StorSimple.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module]::Instance + + # Ask for the shared functionality table + $VTable = Register-AzModule + + # Tweaks the pipeline on module load + $instance.OnModuleLoad = $VTable.OnModuleLoad + + # Following two delegates are added for telemetry + $instance.GetTelemetryId = $VTable.GetTelemetryId + $instance.Telemetry = $VTable.Telemetry + + + # Tweaks the pipeline per call + $instance.OnNewRequest = $VTable.OnNewRequest + + # Gets shared parameter values + $instance.GetParameterValue = $VTable.GetParameterValue + + # Allows shared module to listen to events from this module + $instance.EventListener = $VTable.EventListener + + # Gets shared argument completers + $instance.ArgumentCompleter = $VTable.ArgumentCompleter + + # The name of the currently selected Azure profile + $instance.ProfileName = $VTable.ProfileName + + + # Load the custom module + $customModulePath = Join-Path $PSScriptRoot './custom/Az.StorSimple.custom.psm1' + if(Test-Path $customModulePath) { + $null = Import-Module -Name $customModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = Join-Path $PSScriptRoot './exports' + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } + + # Finalize initialization of this module + $instance.Init(); + Write-Information "Loaded Module '$($instance.Name)'" +# endregion diff --git a/swaggerci/storSimple1200Series/MSSharedLibKey.snk b/swaggerci/storSimple1200Series/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/swaggerci/storSimple1200Series/MSSharedLibKey.snk differ diff --git a/swaggerci/storSimple1200Series/README.md b/swaggerci/storSimple1200Series/README.md new file mode 100644 index 000000000000..b605d111fe0a --- /dev/null +++ b/swaggerci/storSimple1200Series/README.md @@ -0,0 +1,27 @@ + +# Az.StorSimple +This directory contains the PowerShell module for the StorSimple service. + +--- +## Status +[![Az.StorSimple](https://img.shields.io/powershellgallery/v/Az.StorSimple.svg?style=flat-square&label=Az.StorSimple "Az.StorSimple")](https://www.powershellgallery.com/packages/Az.StorSimple/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.StorSimple`, see [how-to.md](how-to.md). + diff --git a/swaggerci/storSimple1200Series/build-module.ps1 b/swaggerci/storSimple1200Series/build-module.ps1 new file mode 100644 index 000000000000..524a32dddcd4 --- /dev/null +++ b/swaggerci/storSimple1200Series/build-module.ps1 @@ -0,0 +1,153 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs) +$ErrorActionPreference = 'Stop' + +if($PSEdition -ne 'Core') { + Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.' +} + +if(-not $Isolated -and -not $Debugger) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + + if($LastExitCode -ne 0) { + # Build failed. Don't attempt to run the module. + return + } + + if($Test) { + . (Join-Path $PSScriptRoot 'test-module.ps1') + if($LastExitCode -ne 0) { + # Tests failed. Don't attempt to run the module. + return + } + } + + if($Docs) { + . (Join-Path $PSScriptRoot 'generate-help.ps1') + if($LastExitCode -ne 0) { + # Docs generation failed. Don't attempt to run the module. + return + } + } + + if($Pack) { + . (Join-Path $PSScriptRoot 'pack-module.ps1') + if($LastExitCode -ne 0) { + # Packing failed. Don't attempt to run the module. + return + } + } + + $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1' + if($Code) { + . $runModulePath -Code + } elseif($Run) { + . $runModulePath + } else { + Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script." + } + return +} + +$binFolder = Join-Path $PSScriptRoot 'bin' +$objFolder = Join-Path $PSScriptRoot 'obj' + +if(-not $Debugger) { + Write-Host -ForegroundColor Green 'Cleaning build folders...' + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder + + if((Test-Path $binFolder) -or (Test-Path $objFolder)) { + Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?' + Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.' + } + + Write-Host -ForegroundColor Green 'Compiling module...' + $buildConfig = 'Debug' + if($Release) { + $buildConfig = 'Release' + } + dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo + if($LastExitCode -ne 0) { + Write-Error 'Compilation failed.' + } + + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release') +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.StorSimple.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} + +# Load DLL to use build-time cmdlets +$null = Import-Module -Name $dll + +$modulePaths = $dll +$customPsm1 = Join-Path $PSScriptRoot 'custom/Az.StorSimple.custom.psm1' +if(Test-Path $customPsm1) { + $modulePaths = @($dll, $customPsm1) +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(Test-Path $exportsFolder) { + $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $exportsFolder + +$internalFolder = Join-Path $PSScriptRoot 'internal' +if(Test-Path $internalFolder) { + $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $internalFolder + +$psd1 = Join-Path $PSScriptRoot './Az.StorSimple.psd1' +$guid = Get-ModuleGuid -Psd1Path $psd1 +$moduleName = 'Az.StorSimple' +$examplesFolder = Join-Path $PSScriptRoot 'examples' +$null = New-Item -ItemType Directory -Force -Path $examplesFolder + +Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...' +$modelCmdlets = @() +if ($modelCmdlets.Count -gt 0) { + . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1') + CreateModelCmdlet($modelCmdlets) +} + +if($NoDocs) { + Write-Host -ForegroundColor Green 'Creating exports...' + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder +} else { + Write-Host -ForegroundColor Green 'Creating exports and docs...' + $moduleDescription = 'Microsoft Azure PowerShell: StorSimple cmdlets' + $docsFolder = Join-Path $PSScriptRoot 'docs' + if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue + } + $null = New-Item -ItemType Directory -Force -Path $docsFolder + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid +} + +Write-Host -ForegroundColor Green 'Creating format.ps1xml...' +$formatPs1xml = Join-Path $PSScriptRoot './Az.StorSimple.format.ps1xml' +Export-FormatPs1xml -FilePath $formatPs1xml + +Write-Host -ForegroundColor Green 'Creating psd1...' +$customFolder = Join-Path $PSScriptRoot 'custom' +Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid + +Write-Host -ForegroundColor Green 'Creating test stubs...' +$testFolder = Join-Path $PSScriptRoot 'test' +$null = New-Item -ItemType Directory -Force -Path $testFolder +Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder + +Write-Host -ForegroundColor Green 'Creating example stubs...' +Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder + +Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/swaggerci/storSimple1200Series/check-dependencies.ps1 b/swaggerci/storSimple1200Series/check-dependencies.ps1 new file mode 100644 index 000000000000..ec3055201a71 --- /dev/null +++ b/swaggerci/storSimple1200Series/check-dependencies.ps1 @@ -0,0 +1,57 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) { + if($predicate) { + $module = Get-Module -ListAvailable -Name $moduleName + if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) { + $null = New-Item -ItemType Directory -Force -Path $path + Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..." + if ($requiredVersion) { + Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path + }elseif($versionMinimum) { + Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path + } else { + Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path + } + } + } +} + +$ProgressPreference = 'SilentlyContinue' +$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1 + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5' +DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1' + +$tools = Join-Path $PSScriptRoot 'tools' +$resourceDir = Join-Path $tools 'Resources' +$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1' + +if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) { + Write-Host -ForegroundColor Green "Building local Resource module used for test..." + Set-Location $resourceDir + $null = autorest .\README.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources + $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/ + Set-Location $HOME/.PSSharedModules/Resources + $null = .\build-module.ps1 + Set-Location $PSScriptRoot +} diff --git a/swaggerci/storSimple1200Series/create-model-cmdlets.ps1 b/swaggerci/storSimple1200Series/create-model-cmdlets.ps1 new file mode 100644 index 000000000000..5fcf2fdae0cf --- /dev/null +++ b/swaggerci/storSimple1200Series/create-model-cmdlets.ps1 @@ -0,0 +1,163 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +function CreateModelCmdlet { + + param([string[]]$Models) + + if ($Models.Count -eq 0) + { + return + } + + $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated/api') 'Models' + $ModuleName = 'StorSimple' + $OutputDir = Join-Path $PSScriptRoot 'custom/autogen-model-cmdlets' + $null = New-Item -ItemType Directory -Force -Path $OutputDir + + $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs + $Content = '' + $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 ) + { $Content += get-content $_.fullname -raw + } } + + $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content) + $Nodes = $Tree.ChildNodes().ChildNodes() + foreach ($Model in $Models) + { + $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$Model") } + if ($InterfaceNode.count -eq 0) { + continue + } + # through a queue, we iterate all the parent models. + $Queue = @($InterfaceNode) + $visited = @("I$Model") + $AllInterfaceNodes = @() + while ($Queue.count -ne 0) + { + $AllInterfaceNodes += $Queue[0] + # Baselist contains the direct parent models. + foreach ($parent in $Queue[0].BaseList.Types) + { + if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value))) + { + $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) }) + $visited = [Array]$visited + $parent.Type.Right.Identifier.Value + } + } + $first, $Queue = $Queue + } + + $Namespace = $InterfaceNode.Parent.Name + $ObjectType = $Model + $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}" + # remove duplicated module name + if ($ObjectType.StartsWith($ModuleName)) { + $ModulePrefix = '' + } else { + $ModulePrefix = $ModuleName + } + $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir + + $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string] + $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string] + foreach ($Node in $AllInterfaceNodes) + { + foreach ($Member in $Node.Members) + { + $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments + $Required = $false + $Description = "" + $Readonly = $False + foreach ($Argument in $Arguments) + { + if ($Argument.NameEquals.Name.Identifier.Value -eq "Required") + { + $Required = $Argument.Expression.Token.Value + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Description") + { + $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"') + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly") + { + $Readonly = $Argument.Expression.Token.Value + } + } + if ($Readonly) + { + continue + } + $Identifier = $Member.Identifier.Value + $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1] + $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string] + if ($Required) + { + $ParameterDefinePropertyList.Add("Mandatory") + } + if ($Description -ne "") + { + $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"") + } + $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList) + # check whether completer is needed + $completer = ''; + if($Type.Split('.').Split('.')[-2] -eq 'Support') { + # If Type is an array, need to strip [] + $strippedType = $Type.Replace('[]', '') + $completer += "`n [ArgumentCompleter([${strippedType}])]" + } + $ParameterDefineScript = " + [Parameter($ParameterDefineProperty)]${completer} + [${Type}] + `$${Identifier}" + $ParameterDefineScriptList.Add($ParameterDefineScript) + $ParameterAssignScriptList.Add(" + if (`$PSBoundParameters.ContainsKey('${Identifier}')) { + `$Object.${Identifier} = `$${Identifier} + }") + } + } + $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator "," + $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator "" + + $Script = " +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for ${ObjectType}. +.Description +Create an in-memory object for ${ObjectType}. + +.Outputs +${ObjectTypeWithNamespace} +.Link +https://docs.microsoft.com/en-us/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object +#> +function New-Az${ModulePrefix}${ObjectType}Object { + [OutputType('${ObjectTypeWithNamespace}')] + [CmdletBinding(PositionalBinding=`$false)] + Param( +${ParameterDefineScript} + ) + + process { + `$Object = [${ObjectTypeWithNamespace}]::New() +${ParameterAssignScript} + return `$Object + } +} +" + Set-Content -Path $OutputPath -Value $Script + } +} diff --git a/swaggerci/storSimple1200Series/custom/Az.StorSimple.custom.psm1 b/swaggerci/storSimple1200Series/custom/Az.StorSimple.custom.psm1 new file mode 100644 index 000000000000..32af6e278ff9 --- /dev/null +++ b/swaggerci/storSimple1200Series/custom/Az.StorSimple.custom.psm1 @@ -0,0 +1,17 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.StorSimple.private.dll') + + # Load the internal module + $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.StorSimple.internal.psm1' + if(Test-Path $internalModulePath) { + $null = Import-Module -Name $internalModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export script cmdlets + Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias) +# endregion diff --git a/swaggerci/storSimple1200Series/custom/README.md b/swaggerci/storSimple1200Series/custom/README.md new file mode 100644 index 000000000000..6d3c33d23e9e --- /dev/null +++ b/swaggerci/storSimple1200Series/custom/README.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.StorSimple` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.StorSimple.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.StorSimple` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. + +For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.StorSimple.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. + +For script cmdlets, these are loaded via the `Az.StorSimple.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. + +## Purpose +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder. + +## Usage +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +- Break +- DefaultProfile +- HttpPipelineAppend +- HttpPipelinePrepend +- Proxy +- ProxyCredential +- ProxyUseDefaultCredentials + +These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.StorSimple`. For C#, follow the usage seen in the `ProcessRecordAsync` method. + +### Attributes +For processing the cmdlets, we've created some additional attributes: +- `Microsoft.Azure.PowerShell.Cmdlets.StorSimple.DescriptionAttribute` + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. +- `Microsoft.Azure.PowerShell.Cmdlets.StorSimple.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.StorSimple`. +- `Microsoft.Azure.PowerShell.Cmdlets.StorSimple.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.StorSimple`. For more information, see [README.md](../internal/README.md) in the `../internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ProfileAttribute` + - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/docs/Az.StorSimple.md b/swaggerci/storSimple1200Series/docs/Az.StorSimple.md new file mode 100644 index 000000000000..35a56853ebb5 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Az.StorSimple.md @@ -0,0 +1,238 @@ +--- +Module Name: Az.StorSimple +Module Guid: 0a430783-990a-47b9-bb3a-1a74838ee9cf +Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.storsimple +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.StorSimple Module +## Description +Microsoft Azure PowerShell: StorSimple cmdlets + +## Az.StorSimple Cmdlets +### [Backup-AzStorSimpleFileServerNow](Backup-AzStorSimpleFileServerNow.md) +Backup the file server now. + +### [Backup-AzStorSimpleIscsiServerNow](Backup-AzStorSimpleIscsiServerNow.md) +Backup the iSCSI server now. + +### [Clear-AzStorSimpleAlert](Clear-AzStorSimpleAlert.md) +Clear the alerts. + +### [Copy-AzStorSimpleBackup](Copy-AzStorSimpleBackup.md) +Clones the given backup element to a new disk or share with given details. + +### [Get-AzStorSimpleAccessControlRecord](Get-AzStorSimpleAccessControlRecord.md) +Returns the properties of the specified access control record name. + +### [Get-AzStorSimpleAlert](Get-AzStorSimpleAlert.md) +Retrieves all the alerts in a manager. + +### [Get-AzStorSimpleAvailableProviderOperation](Get-AzStorSimpleAvailableProviderOperation.md) +List of AvailableProviderOperations + +### [Get-AzStorSimpleBackup](Get-AzStorSimpleBackup.md) +Retrieves all the backups in a manager. + +### [Get-AzStorSimpleBackupScheduleGroup](Get-AzStorSimpleBackupScheduleGroup.md) +Returns the properties of the specified backup schedule group name. + +### [Get-AzStorSimpleChapSetting](Get-AzStorSimpleChapSetting.md) +Returns the properties of the specified chap setting name. + +### [Get-AzStorSimpleDevice](Get-AzStorSimpleDevice.md) +Returns the properties of the specified device name. + +### [Get-AzStorSimpleDeviceAlertSetting](Get-AzStorSimpleDeviceAlertSetting.md) +Returns the alert settings of the specified device name. + +### [Get-AzStorSimpleDeviceFailoverTarget](Get-AzStorSimpleDeviceFailoverTarget.md) +Retrieves all the devices which can be used as failover targets for the given device. + +### [Get-AzStorSimpleDeviceMetric](Get-AzStorSimpleDeviceMetric.md) +Retrieves the device metrics. + +### [Get-AzStorSimpleDeviceMetricDefinition](Get-AzStorSimpleDeviceMetricDefinition.md) +Retrieves metric definition of all metrics aggregated at device. + +### [Get-AzStorSimpleDeviceNetworkSetting](Get-AzStorSimpleDeviceNetworkSetting.md) +Returns the network settings of the specified device name. + +### [Get-AzStorSimpleDeviceTimeSetting](Get-AzStorSimpleDeviceTimeSetting.md) +Returns the time settings of the specified device name. + +### [Get-AzStorSimpleDeviceUpdateSummary](Get-AzStorSimpleDeviceUpdateSummary.md) +Returns the update summary of the specified device name. + +### [Get-AzStorSimpleFileServer](Get-AzStorSimpleFileServer.md) +Returns the properties of the specified file server name. + +### [Get-AzStorSimpleFileServerMetric](Get-AzStorSimpleFileServerMetric.md) +Gets the file server metrics. + +### [Get-AzStorSimpleFileServerMetricDefinition](Get-AzStorSimpleFileServerMetricDefinition.md) +Retrieves metric definitions of all metrics aggregated at the file server. + +### [Get-AzStorSimpleFileShare](Get-AzStorSimpleFileShare.md) +Returns the properties of the specified file share name. + +### [Get-AzStorSimpleFileShareMetric](Get-AzStorSimpleFileShareMetric.md) +Gets the file share metrics + +### [Get-AzStorSimpleFileShareMetricDefinition](Get-AzStorSimpleFileShareMetricDefinition.md) +Retrieves metric definitions of all metrics aggregated at the file share. + +### [Get-AzStorSimpleIscsiDisk](Get-AzStorSimpleIscsiDisk.md) +Returns the properties of the specified iSCSI disk name. + +### [Get-AzStorSimpleIscsiDiskMetric](Get-AzStorSimpleIscsiDiskMetric.md) +Gets the iSCSI disk metrics + +### [Get-AzStorSimpleIscsiDiskMetricDefinition](Get-AzStorSimpleIscsiDiskMetricDefinition.md) +Retrieves metric definitions for all metric aggregated at the iSCSI disk. + +### [Get-AzStorSimpleIscsiServer](Get-AzStorSimpleIscsiServer.md) +Returns the properties of the specified iSCSI server name. + +### [Get-AzStorSimpleIscsiServerMetric](Get-AzStorSimpleIscsiServerMetric.md) +Gets the iSCSI server metrics + +### [Get-AzStorSimpleIscsiServerMetricDefinition](Get-AzStorSimpleIscsiServerMetricDefinition.md) +Retrieves metric definitions for all metrics aggregated at iSCSI server. + +### [Get-AzStorSimpleJob](Get-AzStorSimpleJob.md) +Returns the properties of the specified job name. + +### [Get-AzStorSimpleManager](Get-AzStorSimpleManager.md) +Returns the properties of the specified manager name. + +### [Get-AzStorSimpleManagerEncryptionKey](Get-AzStorSimpleManagerEncryptionKey.md) +Returns the symmetric encryption key of the manager. + +### [Get-AzStorSimpleManagerEncryptionSetting](Get-AzStorSimpleManagerEncryptionSetting.md) +Returns the encryption settings of the manager. + +### [Get-AzStorSimpleManagerExtendedInfo](Get-AzStorSimpleManagerExtendedInfo.md) +Returns the extended information of the specified manager name. + +### [Get-AzStorSimpleManagerMetric](Get-AzStorSimpleManagerMetric.md) +Gets the manager metrics + +### [Get-AzStorSimpleManagerMetricDefinition](Get-AzStorSimpleManagerMetricDefinition.md) +Retrieves metric definition of all metrics aggregated at manager. + +### [Get-AzStorSimpleStorageAccountCredentials](Get-AzStorSimpleStorageAccountCredentials.md) +Returns the properties of the specified storage account credential name. + +### [Get-AzStorSimpleStorageDomain](Get-AzStorSimpleStorageDomain.md) +Returns the properties of the specified storage domain name. + +### [Install-AzStorSimpleDeviceUpdate](Install-AzStorSimpleDeviceUpdate.md) +Installs the updates on the device. + +### [Invoke-AzStorSimpleDeactivateDevice](Invoke-AzStorSimpleDeactivateDevice.md) +Deactivates the device. + +### [Invoke-AzStorSimpleDownloadDeviceUpdate](Invoke-AzStorSimpleDownloadDeviceUpdate.md) +Downloads updates on the device. + +### [Invoke-AzStorSimpleScanDevice](Invoke-AzStorSimpleScanDevice.md) +Scans for updates on the device. + +### [Invoke-AzStorSimpleUploadManagerRegistrationCertificate](Invoke-AzStorSimpleUploadManagerRegistrationCertificate.md) +Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse + +### [New-AzStorSimpleAccessControlRecord](New-AzStorSimpleAccessControlRecord.md) +Creates or Updates an access control record. + +### [New-AzStorSimpleBackupScheduleGroup](New-AzStorSimpleBackupScheduleGroup.md) +Creates or Updates the backup schedule Group. + +### [New-AzStorSimpleChapSetting](New-AzStorSimpleChapSetting.md) +Creates or updates the chap setting. + +### [New-AzStorSimpleDeviceAlertSetting](New-AzStorSimpleDeviceAlertSetting.md) +Creates or updates the alert settings + +### [New-AzStorSimpleDeviceSecuritySetting](New-AzStorSimpleDeviceSecuritySetting.md) +Creates or updates the security settings. + +### [New-AzStorSimpleFileServer](New-AzStorSimpleFileServer.md) +Creates or updates the file server. + +### [New-AzStorSimpleFileShare](New-AzStorSimpleFileShare.md) +Creates or updates the file share. + +### [New-AzStorSimpleIscsiDisk](New-AzStorSimpleIscsiDisk.md) +Creates or updates the iSCSI disk. + +### [New-AzStorSimpleIscsiServer](New-AzStorSimpleIscsiServer.md) +Creates or updates the iSCSI server. + +### [New-AzStorSimpleManager](New-AzStorSimpleManager.md) +Creates or updates the manager. + +### [New-AzStorSimpleManagerExtendedInfo](New-AzStorSimpleManagerExtendedInfo.md) +Creates the extended info of the manager. + +### [New-AzStorSimpleStorageAccountCredentials](New-AzStorSimpleStorageAccountCredentials.md) +Creates or updates the storage account credential + +### [New-AzStorSimpleStorageDomain](New-AzStorSimpleStorageDomain.md) +Creates or updates the storage domain. + +### [Remove-AzStorSimpleAccessControlRecord](Remove-AzStorSimpleAccessControlRecord.md) +Deletes the access control record. + +### [Remove-AzStorSimpleBackup](Remove-AzStorSimpleBackup.md) +Deletes the backup. + +### [Remove-AzStorSimpleBackupScheduleGroup](Remove-AzStorSimpleBackupScheduleGroup.md) +Deletes the backup schedule group. + +### [Remove-AzStorSimpleChapSetting](Remove-AzStorSimpleChapSetting.md) +Deletes the chap setting. + +### [Remove-AzStorSimpleDevice](Remove-AzStorSimpleDevice.md) +Deletes the device. + +### [Remove-AzStorSimpleFileServer](Remove-AzStorSimpleFileServer.md) +Deletes the file server. + +### [Remove-AzStorSimpleFileShare](Remove-AzStorSimpleFileShare.md) +Deletes the file share. + +### [Remove-AzStorSimpleIscsiDisk](Remove-AzStorSimpleIscsiDisk.md) +Deletes the iSCSI disk. + +### [Remove-AzStorSimpleIscsiServer](Remove-AzStorSimpleIscsiServer.md) +Deletes the iSCSI server. + +### [Remove-AzStorSimpleManager](Remove-AzStorSimpleManager.md) +Deletes the manager. + +### [Remove-AzStorSimpleManagerExtendedInfo](Remove-AzStorSimpleManagerExtendedInfo.md) +Deletes the extended info of the manager. + +### [Remove-AzStorSimpleStorageAccountCredentials](Remove-AzStorSimpleStorageAccountCredentials.md) +Deletes the storage account credential + +### [Remove-AzStorSimpleStorageDomain](Remove-AzStorSimpleStorageDomain.md) +Deletes the storage domain. + +### [Send-AzStorSimpleAlertTestEmail](Send-AzStorSimpleAlertTestEmail.md) +Sends a test alert email. + +### [Update-AzStorSimpleDevice](Update-AzStorSimpleDevice.md) +Patches the device. + +### [Update-AzStorSimpleDeviceSecuritySetting](Update-AzStorSimpleDeviceSecuritySetting.md) +Creates or updates the security settings. + +### [Update-AzStorSimpleManager](Update-AzStorSimpleManager.md) +Updates the StorSimple Manager. + +### [Update-AzStorSimpleManagerExtendedInfo](Update-AzStorSimpleManagerExtendedInfo.md) +Updates the extended info of the manager. + diff --git a/swaggerci/storSimple1200Series/docs/Backup-AzStorSimpleFileServerNow.md b/swaggerci/storSimple1200Series/docs/Backup-AzStorSimpleFileServerNow.md new file mode 100644 index 000000000000..6a5a2456ffba --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Backup-AzStorSimpleFileServerNow.md @@ -0,0 +1,280 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/backup-azstorsimplefileservernow +schema: 2.0.0 +--- + +# Backup-AzStorSimpleFileServerNow + +## SYNOPSIS +Backup the file server now. + +## SYNTAX + +### Backup (Default) +``` +Backup-AzStorSimpleFileServerNow -DeviceName -FileServerName -ManagerName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### BackupViaIdentity +``` +Backup-AzStorSimpleFileServerNow -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Backup the file server now. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Backup +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileServerName +The file server name. + +```yaml +Type: System.String +Parameter Sets: Backup +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: BackupViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Backup +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Backup +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Backup +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Backup-AzStorSimpleIscsiServerNow.md b/swaggerci/storSimple1200Series/docs/Backup-AzStorSimpleIscsiServerNow.md new file mode 100644 index 000000000000..a3812d1844dc --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Backup-AzStorSimpleIscsiServerNow.md @@ -0,0 +1,280 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/backup-azstorsimpleiscsiservernow +schema: 2.0.0 +--- + +# Backup-AzStorSimpleIscsiServerNow + +## SYNOPSIS +Backup the iSCSI server now. + +## SYNTAX + +### Backup (Default) +``` +Backup-AzStorSimpleIscsiServerNow -DeviceName -IscsiServerName -ManagerName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### BackupViaIdentity +``` +Backup-AzStorSimpleIscsiServerNow -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Backup the iSCSI server now. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Backup +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: BackupViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -IscsiServerName +The iSCSI server name. + +```yaml +Type: System.String +Parameter Sets: Backup +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Backup +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Backup +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Backup +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Clear-AzStorSimpleAlert.md b/swaggerci/storSimple1200Series/docs/Clear-AzStorSimpleAlert.md new file mode 100644 index 000000000000..ce2a97a88369 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Clear-AzStorSimpleAlert.md @@ -0,0 +1,284 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/clear-azstorsimplealert +schema: 2.0.0 +--- + +# Clear-AzStorSimpleAlert + +## SYNOPSIS +Clear the alerts. + +## SYNTAX + +### ClearExpanded (Default) +``` +Clear-AzStorSimpleAlert -ManagerName -ResourceGroupName -Alert + [-SubscriptionId ] [-ResolutionMessage ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### Clear +``` +Clear-AzStorSimpleAlert -ManagerName -ResourceGroupName -Request + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### ClearViaIdentity +``` +Clear-AzStorSimpleAlert -InputObject -Request + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### ClearViaIdentityExpanded +``` +Clear-AzStorSimpleAlert -InputObject -Alert [-ResolutionMessage ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Clear the alerts. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -Alert +List of alert Ids to be cleared + +```yaml +Type: System.String[] +Parameter Sets: ClearExpanded, ClearViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: ClearViaIdentity, ClearViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Clear, ClearExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Request +Request for clearing the alert +To construct, see NOTES section for REQUEST properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest +Parameter Sets: Clear, ClearViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResolutionMessage +Resolution message while clearing the request + +```yaml +Type: System.String +Parameter Sets: ClearExpanded, ClearViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Clear, ClearExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Clear, ClearExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +REQUEST : Request for clearing the alert + - `Alert `: List of alert Ids to be cleared + - `[ResolutionMessage ]`: Resolution message while clearing the request + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Copy-AzStorSimpleBackup.md b/swaggerci/storSimple1200Series/docs/Copy-AzStorSimpleBackup.md new file mode 100644 index 000000000000..d3d24e08bcd4 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Copy-AzStorSimpleBackup.md @@ -0,0 +1,582 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/copy-azstorsimplebackup +schema: 2.0.0 +--- + +# Copy-AzStorSimpleBackup + +## SYNOPSIS +Clones the given backup element to a new disk or share with given details. + +## SYNTAX + +### CloneExpanded (Default) +``` +Copy-AzStorSimpleBackup -DeviceName -ElementName -ManagerName -Name + -ResourceGroupName -NewEndpointName -TargetAccessPointId -TargetDeviceId + [-SubscriptionId ] [-AccessControlRecord ] [-AdminUser ] + [-DiskPropertiesDataPolicy ] [-DiskPropertiesDescription ] + [-DiskPropertiesMonitoringStatus ] [-DiskPropertiesProvisionedCapacityInByte ] + [-DiskStatus ] [-SharePropertiesDataPolicy ] [-SharePropertiesDescription ] + [-SharePropertiesMonitoringStatus ] [-SharePropertiesProvisionedCapacityInByte ] + [-ShareStatus ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### Clone +``` +Copy-AzStorSimpleBackup -DeviceName -ElementName -ManagerName -Name + -ResourceGroupName -CloneRequest [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### CloneViaIdentity +``` +Copy-AzStorSimpleBackup -InputObject -CloneRequest + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### CloneViaIdentityExpanded +``` +Copy-AzStorSimpleBackup -InputObject -NewEndpointName + -TargetAccessPointId -TargetDeviceId [-AccessControlRecord ] + [-AdminUser ] [-DiskPropertiesDataPolicy ] [-DiskPropertiesDescription ] + [-DiskPropertiesMonitoringStatus ] [-DiskPropertiesProvisionedCapacityInByte ] + [-DiskStatus ] [-SharePropertiesDataPolicy ] [-SharePropertiesDescription ] + [-SharePropertiesMonitoringStatus ] [-SharePropertiesProvisionedCapacityInByte ] + [-ShareStatus ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Clones the given backup element to a new disk or share with given details. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccessControlRecord +The access control records. + +```yaml +Type: System.String[] +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdminUser +The user/group who will have full permission in this share. +Active directory email address. +Example: xyz@contoso.com or Contoso\xyz. + +```yaml +Type: System.String +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CloneRequest +Clone Job Request Model. +To construct, see NOTES section for CLONEREQUEST properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest +Parameter Sets: Clone, CloneViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Clone, CloneExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskPropertiesDataPolicy +The data policy. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskPropertiesDescription +The description. + +```yaml +Type: System.String +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskPropertiesMonitoringStatus +The monitoring. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskPropertiesProvisionedCapacityInByte +The provisioned capacity in bytes. + +```yaml +Type: System.Int64 +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskStatus +The disk status. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ElementName +The backup element name. + +```yaml +Type: System.String +Parameter Sets: Clone, CloneExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: CloneViaIdentity, CloneViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Clone, CloneExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The backup name. + +```yaml +Type: System.String +Parameter Sets: Clone, CloneExpanded +Aliases: BackupName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NewEndpointName +Name of new endpoint which will created as part of clone job. + +```yaml +Type: System.String +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Clone, CloneExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SharePropertiesDataPolicy +The data policy + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SharePropertiesDescription +Description for file share + +```yaml +Type: System.String +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SharePropertiesMonitoringStatus +The monitoring status + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SharePropertiesProvisionedCapacityInByte +The total provisioned capacity in Bytes + +```yaml +Type: System.Int64 +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShareStatus +The Share Status + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Clone, CloneExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetAccessPointId +Access point Id on which clone job will performed. + +```yaml +Type: System.String +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TargetDeviceId +DeviceId of the device which will act as the Clone target + +```yaml +Type: System.String +Parameter Sets: CloneExpanded, CloneViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +CLONEREQUEST : Clone Job Request Model. + - `NewEndpointName `: Name of new endpoint which will created as part of clone job. + - `TargetAccessPointId `: Access point Id on which clone job will performed. + - `TargetDeviceId `: DeviceId of the device which will act as the Clone target + - `[AccessControlRecord ]`: The access control records. + - `[AdminUser ]`: The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\xyz. + - `[DiskPropertiesDataPolicy ]`: The data policy. + - `[DiskPropertiesDescription ]`: The description. + - `[DiskPropertiesMonitoringStatus ]`: The monitoring. + - `[DiskPropertiesProvisionedCapacityInByte ]`: The provisioned capacity in bytes. + - `[DiskStatus ]`: The disk status. + - `[SharePropertiesDataPolicy ]`: The data policy + - `[SharePropertiesDescription ]`: Description for file share + - `[SharePropertiesMonitoringStatus ]`: The monitoring status + - `[SharePropertiesProvisionedCapacityInByte ]`: The total provisioned capacity in Bytes + - `[ShareStatus ]`: The Share Status + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleAccessControlRecord.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleAccessControlRecord.md new file mode 100644 index 000000000000..0e798f1e7b6d --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleAccessControlRecord.md @@ -0,0 +1,194 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleaccesscontrolrecord +schema: 2.0.0 +--- + +# Get-AzStorSimpleAccessControlRecord + +## SYNOPSIS +Returns the properties of the specified access control record name. + +## SYNTAX + +### List (Default) +``` +Get-AzStorSimpleAccessControlRecord -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorSimpleAccessControlRecord -ManagerName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleAccessControlRecord -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the properties of the specified access control record name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of access control record to be fetched. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: AccessControlRecordName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleAlert.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleAlert.md new file mode 100644 index 000000000000..0ea1e4fcf193 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleAlert.md @@ -0,0 +1,138 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplealert +schema: 2.0.0 +--- + +# Get-AzStorSimpleAlert + +## SYNOPSIS +Retrieves all the alerts in a manager. + +## SYNTAX + +``` +Get-AzStorSimpleAlert -ManagerName -ResourceGroupName [-SubscriptionId ] + [-Filter ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Retrieves all the alerts in a manager. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData Filter options + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleAvailableProviderOperation.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleAvailableProviderOperation.md new file mode 100644 index 000000000000..e22a38ff29f5 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleAvailableProviderOperation.md @@ -0,0 +1,77 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleavailableprovideroperation +schema: 2.0.0 +--- + +# Get-AzStorSimpleAvailableProviderOperation + +## SYNOPSIS +List of AvailableProviderOperations + +## SYNTAX + +``` +Get-AzStorSimpleAvailableProviderOperation [-DefaultProfile ] [] +``` + +## DESCRIPTION +List of AvailableProviderOperations + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleBackup.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleBackup.md new file mode 100644 index 000000000000..dff3fdc9ca7e --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleBackup.md @@ -0,0 +1,176 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplebackup +schema: 2.0.0 +--- + +# Get-AzStorSimpleBackup + +## SYNOPSIS +Retrieves all the backups in a manager. + +## SYNTAX + +### List (Default) +``` +Get-AzStorSimpleBackup -ManagerName -ResourceGroupName [-SubscriptionId ] + [-Filter ] [-DefaultProfile ] [] +``` + +### List1 +``` +Get-AzStorSimpleBackup -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-Filter ] [-ForFailover] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Retrieves all the backups in a manager. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData Filter options + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ForFailover +Set to true if you need backups which can be used for failover. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleBackupScheduleGroup.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleBackupScheduleGroup.md new file mode 100644 index 000000000000..54bd2e900c39 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleBackupScheduleGroup.md @@ -0,0 +1,209 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplebackupschedulegroup +schema: 2.0.0 +--- + +# Get-AzStorSimpleBackupScheduleGroup + +## SYNOPSIS +Returns the properties of the specified backup schedule group name. + +## SYNTAX + +### List (Default) +``` +Get-AzStorSimpleBackupScheduleGroup -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorSimpleBackupScheduleGroup -DeviceName -ManagerName -ResourceGroupName + -ScheduleGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleBackupScheduleGroup -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the properties of the specified backup schedule group name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The name of the device. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScheduleGroupName +The name of the schedule group. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleChapSetting.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleChapSetting.md new file mode 100644 index 000000000000..9da633e449ff --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleChapSetting.md @@ -0,0 +1,209 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplechapsetting +schema: 2.0.0 +--- + +# Get-AzStorSimpleChapSetting + +## SYNOPSIS +Returns the properties of the specified chap setting name. + +## SYNTAX + +### List (Default) +``` +Get-AzStorSimpleChapSetting -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorSimpleChapSetting -ChapUserName -DeviceName -ManagerName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleChapSetting -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the properties of the specified chap setting name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ChapUserName +The user name of chap to be fetched. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDevice.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDevice.md new file mode 100644 index 000000000000..30b63bc48189 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDevice.md @@ -0,0 +1,209 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevice +schema: 2.0.0 +--- + +# Get-AzStorSimpleDevice + +## SYNOPSIS +Returns the properties of the specified device name. + +## SYNTAX + +### List (Default) +``` +Get-AzStorSimpleDevice -ManagerName -ResourceGroupName [-SubscriptionId ] + [-Expand ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorSimpleDevice -ManagerName -Name -ResourceGroupName + [-SubscriptionId ] [-Expand ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleDevice -InputObject [-Expand ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the properties of the specified device name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +Specify $expand=details to populate additional fields related to the device. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The device name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: DeviceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceAlertSetting.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceAlertSetting.md new file mode 100644 index 000000000000..cfea53f9d4e3 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceAlertSetting.md @@ -0,0 +1,188 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicealertsetting +schema: 2.0.0 +--- + +# Get-AzStorSimpleDeviceAlertSetting + +## SYNOPSIS +Returns the alert settings of the specified device name. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorSimpleDeviceAlertSetting -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleDeviceAlertSetting -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the alert settings of the specified device name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceFailoverTarget.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceFailoverTarget.md new file mode 100644 index 000000000000..50360faa2e65 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceFailoverTarget.md @@ -0,0 +1,153 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicefailovertarget +schema: 2.0.0 +--- + +# Get-AzStorSimpleDeviceFailoverTarget + +## SYNOPSIS +Retrieves all the devices which can be used as failover targets for the given device. + +## SYNTAX + +``` +Get-AzStorSimpleDeviceFailoverTarget -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-Expand ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Retrieves all the devices which can be used as failover targets for the given device. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +Specify $expand=details to populate additional fields related to the device. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceMetric.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceMetric.md new file mode 100644 index 000000000000..b9f68b0b3dc5 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceMetric.md @@ -0,0 +1,153 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicemetric +schema: 2.0.0 +--- + +# Get-AzStorSimpleDeviceMetric + +## SYNOPSIS +Retrieves the device metrics. + +## SYNTAX + +``` +Get-AzStorSimpleDeviceMetric -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-Filter ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Retrieves the device metrics. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The name of the appliance. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData Filter options + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceMetricDefinition.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceMetricDefinition.md new file mode 100644 index 000000000000..abc7fbf490c4 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceMetricDefinition.md @@ -0,0 +1,138 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicemetricdefinition +schema: 2.0.0 +--- + +# Get-AzStorSimpleDeviceMetricDefinition + +## SYNOPSIS +Retrieves metric definition of all metrics aggregated at device. + +## SYNTAX + +``` +Get-AzStorSimpleDeviceMetricDefinition -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Retrieves metric definition of all metrics aggregated at device. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The name of the appliance. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceNetworkSetting.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceNetworkSetting.md new file mode 100644 index 000000000000..0842f7b315af --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceNetworkSetting.md @@ -0,0 +1,188 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicenetworksetting +schema: 2.0.0 +--- + +# Get-AzStorSimpleDeviceNetworkSetting + +## SYNOPSIS +Returns the network settings of the specified device name. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorSimpleDeviceNetworkSetting -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleDeviceNetworkSetting -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the network settings of the specified device name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceTimeSetting.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceTimeSetting.md new file mode 100644 index 000000000000..957c68e5ca84 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceTimeSetting.md @@ -0,0 +1,188 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicetimesetting +schema: 2.0.0 +--- + +# Get-AzStorSimpleDeviceTimeSetting + +## SYNOPSIS +Returns the time settings of the specified device name. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorSimpleDeviceTimeSetting -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleDeviceTimeSetting -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the time settings of the specified device name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceUpdateSummary.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceUpdateSummary.md new file mode 100644 index 000000000000..3e6f68246eb3 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleDeviceUpdateSummary.md @@ -0,0 +1,188 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledeviceupdatesummary +schema: 2.0.0 +--- + +# Get-AzStorSimpleDeviceUpdateSummary + +## SYNOPSIS +Returns the update summary of the specified device name. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorSimpleDeviceUpdateSummary -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleDeviceUpdateSummary -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the update summary of the specified device name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileServer.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileServer.md new file mode 100644 index 000000000000..6fac8d7a2f3d --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileServer.md @@ -0,0 +1,215 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefileserver +schema: 2.0.0 +--- + +# Get-AzStorSimpleFileServer + +## SYNOPSIS +Returns the properties of the specified file server name. + +## SYNTAX + +### List1 (Default) +``` +Get-AzStorSimpleFileServer -ManagerName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorSimpleFileServer -DeviceName -ManagerName -Name + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleFileServer -InputObject [-DefaultProfile ] + [] +``` + +### List +``` +Get-AzStorSimpleFileServer -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Returns the properties of the specified file server name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get, List, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The file server name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: FileServerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get, List, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileServerMetric.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileServerMetric.md new file mode 100644 index 000000000000..71dda9e0ad94 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileServerMetric.md @@ -0,0 +1,169 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefileservermetric +schema: 2.0.0 +--- + +# Get-AzStorSimpleFileServerMetric + +## SYNOPSIS +Gets the file server metrics. + +## SYNTAX + +``` +Get-AzStorSimpleFileServerMetric -DeviceName -FileServerName -ManagerName + -ResourceGroupName [-SubscriptionId ] [-Filter ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the file server metrics. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The name of the device. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileServerName +The name of the file server name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData Filter options + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileServerMetricDefinition.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileServerMetricDefinition.md new file mode 100644 index 000000000000..8e8c55b22ba4 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileServerMetricDefinition.md @@ -0,0 +1,153 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefileservermetricdefinition +schema: 2.0.0 +--- + +# Get-AzStorSimpleFileServerMetricDefinition + +## SYNOPSIS +Retrieves metric definitions of all metrics aggregated at the file server. + +## SYNTAX + +``` +Get-AzStorSimpleFileServerMetricDefinition -DeviceName -FileServerName -ManagerName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Retrieves metric definitions of all metrics aggregated at the file server. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The name of the device. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileServerName +The name of the file server. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileShare.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileShare.md new file mode 100644 index 000000000000..6eb46f2acd48 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileShare.md @@ -0,0 +1,230 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefileshare +schema: 2.0.0 +--- + +# Get-AzStorSimpleFileShare + +## SYNOPSIS +Returns the properties of the specified file share name. + +## SYNTAX + +### List1 (Default) +``` +Get-AzStorSimpleFileShare -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorSimpleFileShare -DeviceName -FileServerName -ManagerName + -ResourceGroupName -ShareName [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleFileShare -InputObject [-DefaultProfile ] [] +``` + +### List +``` +Get-AzStorSimpleFileShare -DeviceName -FileServerName -ManagerName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Returns the properties of the specified file share name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Get, List, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileServerName +The file server name. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get, List, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get, List, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShareName +The file share name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileShareMetric.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileShareMetric.md new file mode 100644 index 000000000000..38775559b968 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileShareMetric.md @@ -0,0 +1,184 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefilesharemetric +schema: 2.0.0 +--- + +# Get-AzStorSimpleFileShareMetric + +## SYNOPSIS +Gets the file share metrics + +## SYNTAX + +``` +Get-AzStorSimpleFileShareMetric -DeviceName -FileServerName -ManagerName + -ResourceGroupName -ShareName [-SubscriptionId ] [-Filter ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the file share metrics + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileServerName +The file server name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData Filter options + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShareName +The file share name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileShareMetricDefinition.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileShareMetricDefinition.md new file mode 100644 index 000000000000..bb9e498c17e2 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleFileShareMetricDefinition.md @@ -0,0 +1,169 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefilesharemetricdefinition +schema: 2.0.0 +--- + +# Get-AzStorSimpleFileShareMetricDefinition + +## SYNOPSIS +Retrieves metric definitions of all metrics aggregated at the file share. + +## SYNTAX + +``` +Get-AzStorSimpleFileShareMetricDefinition -DeviceName -FileServerName -ManagerName + -ResourceGroupName -ShareName [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Retrieves metric definitions of all metrics aggregated at the file share. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileServerName +The file server name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShareName +The file share name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiDisk.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiDisk.md new file mode 100644 index 000000000000..abdfc08bbfe0 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiDisk.md @@ -0,0 +1,230 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsidisk +schema: 2.0.0 +--- + +# Get-AzStorSimpleIscsiDisk + +## SYNOPSIS +Returns the properties of the specified iSCSI disk name. + +## SYNTAX + +### List (Default) +``` +Get-AzStorSimpleIscsiDisk -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorSimpleIscsiDisk -DeviceName -DiskName -IscsiServerName + -ManagerName -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleIscsiDisk -InputObject [-DefaultProfile ] [] +``` + +### List1 +``` +Get-AzStorSimpleIscsiDisk -DeviceName -IscsiServerName -ManagerName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Returns the properties of the specified iSCSI disk name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Get, List, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskName +The disk name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -IscsiServerName +The iSCSI server name. + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get, List, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get, List, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiDiskMetric.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiDiskMetric.md new file mode 100644 index 000000000000..e44b33ebb63e --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiDiskMetric.md @@ -0,0 +1,184 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsidiskmetric +schema: 2.0.0 +--- + +# Get-AzStorSimpleIscsiDiskMetric + +## SYNOPSIS +Gets the iSCSI disk metrics + +## SYNTAX + +``` +Get-AzStorSimpleIscsiDiskMetric -DeviceName -DiskName -IscsiServerName + -ManagerName -ResourceGroupName [-SubscriptionId ] [-Filter ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the iSCSI disk metrics + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskName +The iSCSI disk name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData Filter options + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IscsiServerName +The iSCSI server name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiDiskMetricDefinition.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiDiskMetricDefinition.md new file mode 100644 index 000000000000..79d618490869 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiDiskMetricDefinition.md @@ -0,0 +1,169 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsidiskmetricdefinition +schema: 2.0.0 +--- + +# Get-AzStorSimpleIscsiDiskMetricDefinition + +## SYNOPSIS +Retrieves metric definitions for all metric aggregated at the iSCSI disk. + +## SYNTAX + +``` +Get-AzStorSimpleIscsiDiskMetricDefinition -DeviceName -DiskName -IscsiServerName + -ManagerName -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Retrieves metric definitions for all metric aggregated at the iSCSI disk. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskName +The iSCSI disk name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IscsiServerName +The iSCSI server name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiServer.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiServer.md new file mode 100644 index 000000000000..6d85eb02b3b4 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiServer.md @@ -0,0 +1,215 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsiserver +schema: 2.0.0 +--- + +# Get-AzStorSimpleIscsiServer + +## SYNOPSIS +Returns the properties of the specified iSCSI server name. + +## SYNTAX + +### List1 (Default) +``` +Get-AzStorSimpleIscsiServer -ManagerName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorSimpleIscsiServer -DeviceName -ManagerName -Name + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleIscsiServer -InputObject [-DefaultProfile ] + [] +``` + +### List +``` +Get-AzStorSimpleIscsiServer -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Returns the properties of the specified iSCSI server name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get, List, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The iSCSI server name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: IscsiServerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get, List, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiServerMetric.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiServerMetric.md new file mode 100644 index 000000000000..03891df274af --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiServerMetric.md @@ -0,0 +1,169 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsiservermetric +schema: 2.0.0 +--- + +# Get-AzStorSimpleIscsiServerMetric + +## SYNOPSIS +Gets the iSCSI server metrics + +## SYNTAX + +``` +Get-AzStorSimpleIscsiServerMetric -DeviceName -IscsiServerName -ManagerName + -ResourceGroupName [-SubscriptionId ] [-Filter ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the iSCSI server metrics + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData Filter options + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IscsiServerName +The iSCSI server name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiServerMetricDefinition.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiServerMetricDefinition.md new file mode 100644 index 000000000000..7caf5962a454 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleIscsiServerMetricDefinition.md @@ -0,0 +1,154 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsiservermetricdefinition +schema: 2.0.0 +--- + +# Get-AzStorSimpleIscsiServerMetricDefinition + +## SYNOPSIS +Retrieves metric definitions for all metrics aggregated at iSCSI server. + +## SYNTAX + +``` +Get-AzStorSimpleIscsiServerMetricDefinition -DeviceName -IscsiServerName + -ManagerName -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Retrieves metric definitions for all metrics aggregated at iSCSI server. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IscsiServerName +The iSCSI server name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleJob.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleJob.md new file mode 100644 index 000000000000..b7ed547e44c9 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleJob.md @@ -0,0 +1,229 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplejob +schema: 2.0.0 +--- + +# Get-AzStorSimpleJob + +## SYNOPSIS +Returns the properties of the specified job name. + +## SYNTAX + +### List1 (Default) +``` +Get-AzStorSimpleJob -ManagerName -ResourceGroupName [-SubscriptionId ] + [-Filter ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorSimpleJob -DeviceName -ManagerName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleJob -InputObject [-DefaultProfile ] [] +``` + +### List +``` +Get-AzStorSimpleJob -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-Filter ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Returns the properties of the specified job name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData Filter options + +```yaml +Type: System.String +Parameter Sets: List, List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get, List, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The job name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: JobName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get, List, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManager.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManager.md new file mode 100644 index 000000000000..30fc376ef93b --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManager.md @@ -0,0 +1,183 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanager +schema: 2.0.0 +--- + +# Get-AzStorSimpleManager + +## SYNOPSIS +Returns the properties of the specified manager name. + +## SYNTAX + +### List (Default) +``` +Get-AzStorSimpleManager [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorSimpleManager -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleManager -InputObject [-DefaultProfile ] [] +``` + +### List1 +``` +Get-AzStorSimpleManager -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the properties of the specified manager name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The manager name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: ManagerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerEncryptionKey.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerEncryptionKey.md new file mode 100644 index 000000000000..311cb95c8b85 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerEncryptionKey.md @@ -0,0 +1,204 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagerencryptionkey +schema: 2.0.0 +--- + +# Get-AzStorSimpleManagerEncryptionKey + +## SYNOPSIS +Returns the symmetric encryption key of the manager. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorSimpleManagerEncryptionKey -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleManagerEncryptionKey -InputObject [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Returns the symmetric encryption key of the manager. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerEncryptionSetting.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerEncryptionSetting.md new file mode 100644 index 000000000000..24851e7d4745 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerEncryptionSetting.md @@ -0,0 +1,173 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagerencryptionsetting +schema: 2.0.0 +--- + +# Get-AzStorSimpleManagerEncryptionSetting + +## SYNOPSIS +Returns the encryption settings of the manager. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorSimpleManagerEncryptionSetting -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleManagerEncryptionSetting -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the encryption settings of the manager. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerExtendedInfo.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerExtendedInfo.md new file mode 100644 index 000000000000..ff6aed0a6ec3 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerExtendedInfo.md @@ -0,0 +1,173 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagerextendedinfo +schema: 2.0.0 +--- + +# Get-AzStorSimpleManagerExtendedInfo + +## SYNOPSIS +Returns the extended information of the specified manager name. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorSimpleManagerExtendedInfo -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleManagerExtendedInfo -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the extended information of the specified manager name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerMetric.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerMetric.md new file mode 100644 index 000000000000..a92291d1372f --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerMetric.md @@ -0,0 +1,138 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagermetric +schema: 2.0.0 +--- + +# Get-AzStorSimpleManagerMetric + +## SYNOPSIS +Gets the manager metrics + +## SYNTAX + +``` +Get-AzStorSimpleManagerMetric -ManagerName -ResourceGroupName [-SubscriptionId ] + [-Filter ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the manager metrics + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +OData Filter options + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerMetricDefinition.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerMetricDefinition.md new file mode 100644 index 000000000000..4be75e9f486f --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleManagerMetricDefinition.md @@ -0,0 +1,123 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagermetricdefinition +schema: 2.0.0 +--- + +# Get-AzStorSimpleManagerMetricDefinition + +## SYNOPSIS +Retrieves metric definition of all metrics aggregated at manager. + +## SYNTAX + +``` +Get-AzStorSimpleManagerMetricDefinition -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Retrieves metric definition of all metrics aggregated at manager. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleStorageAccountCredentials.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleStorageAccountCredentials.md new file mode 100644 index 000000000000..017b90f8dff9 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleStorageAccountCredentials.md @@ -0,0 +1,194 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplestorageaccountcredentials +schema: 2.0.0 +--- + +# Get-AzStorSimpleStorageAccountCredentials + +## SYNOPSIS +Returns the properties of the specified storage account credential name. + +## SYNTAX + +### List (Default) +``` +Get-AzStorSimpleStorageAccountCredentials -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorSimpleStorageAccountCredentials -CredentialName -ManagerName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleStorageAccountCredentials -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the properties of the specified storage account credential name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -CredentialName +The name of storage account credential to be fetched. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleStorageDomain.md b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleStorageDomain.md new file mode 100644 index 000000000000..aa616c31b8f0 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Get-AzStorSimpleStorageDomain.md @@ -0,0 +1,194 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplestoragedomain +schema: 2.0.0 +--- + +# Get-AzStorSimpleStorageDomain + +## SYNOPSIS +Returns the properties of the specified storage domain name. + +## SYNTAX + +### List (Default) +``` +Get-AzStorSimpleStorageDomain -ManagerName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorSimpleStorageDomain -ManagerName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorSimpleStorageDomain -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Returns the properties of the specified storage domain name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The storage domain name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: StorageDomainName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Install-AzStorSimpleDeviceUpdate.md b/swaggerci/storSimple1200Series/docs/Install-AzStorSimpleDeviceUpdate.md new file mode 100644 index 000000000000..1704530569ff --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Install-AzStorSimpleDeviceUpdate.md @@ -0,0 +1,265 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/install-azstorsimpledeviceupdate +schema: 2.0.0 +--- + +# Install-AzStorSimpleDeviceUpdate + +## SYNOPSIS +Installs the updates on the device. + +## SYNTAX + +### Install (Default) +``` +Install-AzStorSimpleDeviceUpdate -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### InstallViaIdentity +``` +Install-AzStorSimpleDeviceUpdate -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Installs the updates on the device. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Install +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: InstallViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Install +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Install +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Install +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Invoke-AzStorSimpleDeactivateDevice.md b/swaggerci/storSimple1200Series/docs/Invoke-AzStorSimpleDeactivateDevice.md new file mode 100644 index 000000000000..40c23980f43b --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Invoke-AzStorSimpleDeactivateDevice.md @@ -0,0 +1,265 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/invoke-azstorsimpledeactivatedevice +schema: 2.0.0 +--- + +# Invoke-AzStorSimpleDeactivateDevice + +## SYNOPSIS +Deactivates the device. + +## SYNTAX + +### Deactivate (Default) +``` +Invoke-AzStorSimpleDeactivateDevice -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeactivateViaIdentity +``` +Invoke-AzStorSimpleDeactivateDevice -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deactivates the device. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Deactivate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeactivateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Deactivate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Deactivate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Deactivate +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Invoke-AzStorSimpleDownloadDeviceUpdate.md b/swaggerci/storSimple1200Series/docs/Invoke-AzStorSimpleDownloadDeviceUpdate.md new file mode 100644 index 000000000000..1e5a9e549a0a --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Invoke-AzStorSimpleDownloadDeviceUpdate.md @@ -0,0 +1,265 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/invoke-azstorsimpledownloaddeviceupdate +schema: 2.0.0 +--- + +# Invoke-AzStorSimpleDownloadDeviceUpdate + +## SYNOPSIS +Downloads updates on the device. + +## SYNTAX + +### Download (Default) +``` +Invoke-AzStorSimpleDownloadDeviceUpdate -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DownloadViaIdentity +``` +Invoke-AzStorSimpleDownloadDeviceUpdate -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Downloads updates on the device. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Download +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DownloadViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Download +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Download +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Download +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Invoke-AzStorSimpleScanDevice.md b/swaggerci/storSimple1200Series/docs/Invoke-AzStorSimpleScanDevice.md new file mode 100644 index 000000000000..9022154963b1 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Invoke-AzStorSimpleScanDevice.md @@ -0,0 +1,265 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/invoke-azstorsimplescandevice +schema: 2.0.0 +--- + +# Invoke-AzStorSimpleScanDevice + +## SYNOPSIS +Scans for updates on the device. + +## SYNTAX + +### Scan (Default) +``` +Invoke-AzStorSimpleScanDevice -DeviceName -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### ScanViaIdentity +``` +Invoke-AzStorSimpleScanDevice -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Scans for updates on the device. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Scan +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: ScanViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Scan +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Scan +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Scan +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Invoke-AzStorSimpleUploadManagerRegistrationCertificate.md b/swaggerci/storSimple1200Series/docs/Invoke-AzStorSimpleUploadManagerRegistrationCertificate.md new file mode 100644 index 000000000000..c98b3b37eadd --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Invoke-AzStorSimpleUploadManagerRegistrationCertificate.md @@ -0,0 +1,287 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/invoke-azstorsimpleuploadmanagerregistrationcertificate +schema: 2.0.0 +--- + +# Invoke-AzStorSimpleUploadManagerRegistrationCertificate + +## SYNOPSIS +Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse + +## SYNTAX + +### UploadExpanded (Default) +``` +Invoke-AzStorSimpleUploadManagerRegistrationCertificate -CertificateName -ManagerName + -ResourceGroupName -Certificate [-SubscriptionId ] [-AuthType ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### Upload +``` +Invoke-AzStorSimpleUploadManagerRegistrationCertificate -CertificateName -ManagerName + -ResourceGroupName -UploadCertificateRequestrequest + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UploadViaIdentity +``` +Invoke-AzStorSimpleUploadManagerRegistrationCertificate -InputObject + -UploadCertificateRequestrequest [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### UploadViaIdentityExpanded +``` +Invoke-AzStorSimpleUploadManagerRegistrationCertificate -InputObject + -Certificate [-AuthType ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AuthType +Specify the Authentication type + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType +Parameter Sets: UploadExpanded, UploadViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Certificate +Gets or sets the base64 encoded certificate raw data string + +```yaml +Type: System.String +Parameter Sets: UploadExpanded, UploadViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CertificateName +Certificate Name + +```yaml +Type: System.String +Parameter Sets: Upload, UploadExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: UploadViaIdentity, UploadViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Upload, UploadExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Upload, UploadExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Upload, UploadExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UploadCertificateRequestrequest +Upload Certificate Request to IDM +To construct, see NOTES section for UPLOADCERTIFICATEREQUESTREQUEST properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest +Parameter Sets: Upload, UploadViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +UPLOADCERTIFICATEREQUESTREQUEST : Upload Certificate Request to IDM + - `Certificate `: Gets or sets the base64 encoded certificate raw data string + - `[AuthType ]`: Specify the Authentication type + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/New-AzStorSimpleAccessControlRecord.md b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleAccessControlRecord.md new file mode 100644 index 000000000000..441d7a9c4746 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleAccessControlRecord.md @@ -0,0 +1,215 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpleaccesscontrolrecord +schema: 2.0.0 +--- + +# New-AzStorSimpleAccessControlRecord + +## SYNOPSIS +Creates or Updates an access control record. + +## SYNTAX + +``` +New-AzStorSimpleAccessControlRecord -ManagerName -Name -ResourceGroupName + -InitiatorName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Creates or Updates an access control record. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InitiatorName +The Iscsi initiator name (IQN) + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the access control record. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: AccessControlRecordName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/New-AzStorSimpleBackupScheduleGroup.md b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleBackupScheduleGroup.md new file mode 100644 index 000000000000..0f2450b0ba14 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleBackupScheduleGroup.md @@ -0,0 +1,245 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplebackupschedulegroup +schema: 2.0.0 +--- + +# New-AzStorSimpleBackupScheduleGroup + +## SYNOPSIS +Creates or Updates the backup schedule Group. + +## SYNTAX + +``` +New-AzStorSimpleBackupScheduleGroup -DeviceName -ManagerName -ResourceGroupName + -ScheduleGroupName -StartTimeHour -StartTimeMinute [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or Updates the backup schedule Group. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The name of the device. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScheduleGroupName +The name of the schedule group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StartTimeHour +The hour. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StartTimeMinute +The minute. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/New-AzStorSimpleChapSetting.md b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleChapSetting.md new file mode 100644 index 000000000000..e524f0759f43 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleChapSetting.md @@ -0,0 +1,262 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplechapsetting +schema: 2.0.0 +--- + +# New-AzStorSimpleChapSetting + +## SYNOPSIS +Creates or updates the chap setting. + +## SYNTAX + +``` +New-AzStorSimpleChapSetting -ChapUserName -DeviceName -ManagerName + -ResourceGroupName -PasswordEncryptionAlgorithm -PasswordValue + [-SubscriptionId ] [-PasswordEncryptionCertificateThumbprint ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates the chap setting. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ChapUserName +The chap user name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PasswordEncryptionAlgorithm +Algorithm used to encrypt "Value" + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PasswordEncryptionCertificateThumbprint +Thumbprint certificate that was used to encrypt "Value" + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PasswordValue +The value of the secret itself. +If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/New-AzStorSimpleDeviceAlertSetting.md b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleDeviceAlertSetting.md new file mode 100644 index 000000000000..8468a6ad504d --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleDeviceAlertSetting.md @@ -0,0 +1,264 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpledevicealertsetting +schema: 2.0.0 +--- + +# New-AzStorSimpleDeviceAlertSetting + +## SYNOPSIS +Creates or updates the alert settings + +## SYNTAX + +``` +New-AzStorSimpleDeviceAlertSetting -DeviceName -ManagerName -ResourceGroupName + -AlertNotificationCulture -EmailNotification + -NotificationToServiceOwner [-SubscriptionId ] + [-AdditionalRecipientEmailList ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates the alert settings + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AdditionalRecipientEmailList +List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AlertNotificationCulture +Culture setting to be used while building alert emails. +For eg: "en-US" + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EmailNotification +Value indicating whether user/admins will receive emails when an alert condition occurs on the system + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NotificationToServiceOwner +Value indicating whether service owners will receive emails when an alert condition occurs on the system. +Applicable only if emailNotification flag is Enabled. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/New-AzStorSimpleDeviceSecuritySetting.md b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleDeviceSecuritySetting.md new file mode 100644 index 000000000000..caf9c853ef1a --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleDeviceSecuritySetting.md @@ -0,0 +1,262 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpledevicesecuritysetting +schema: 2.0.0 +--- + +# New-AzStorSimpleDeviceSecuritySetting + +## SYNOPSIS +Creates or updates the security settings. + +## SYNTAX + +``` +New-AzStorSimpleDeviceSecuritySetting -DeviceName -ManagerName -ResourceGroupName + -DeviceAdminPasswordEncryptionAlgorithm -DeviceAdminPasswordValue + [-SubscriptionId ] [-DeviceAdminPasswordEncryptionCertificateThumbprint ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates the security settings. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceAdminPasswordEncryptionAlgorithm +Algorithm used to encrypt "Value" + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceAdminPasswordEncryptionCertificateThumbprint +Thumbprint certificate that was used to encrypt "Value" + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceAdminPasswordValue +The value of the secret itself. +If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/New-AzStorSimpleFileServer.md b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleFileServer.md new file mode 100644 index 000000000000..bf324b293f7d --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleFileServer.md @@ -0,0 +1,276 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplefileserver +schema: 2.0.0 +--- + +# New-AzStorSimpleFileServer + +## SYNOPSIS +Creates or updates the file server. + +## SYNTAX + +``` +New-AzStorSimpleFileServer -DeviceName -ManagerName -Name + -ResourceGroupName -BackupScheduleGroupId -DomainName -StorageDomainId + [-SubscriptionId ] [-Description ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates the file server. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BackupScheduleGroupId +The backup policy id. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +The description of the file server + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DomainName +Domain of the file server + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The file server name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: FileServerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageDomainId +The storage domain id. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/New-AzStorSimpleFileShare.md b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleFileShare.md new file mode 100644 index 000000000000..111343bee67f --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleFileShare.md @@ -0,0 +1,324 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplefileshare +schema: 2.0.0 +--- + +# New-AzStorSimpleFileShare + +## SYNOPSIS +Creates or updates the file share. + +## SYNTAX + +``` +New-AzStorSimpleFileShare -DeviceName -FileServerName -ManagerName + -ResourceGroupName -ShareName -AdminUser -DataPolicy + -MonitoringStatus -ProvisionedCapacityInByte -ShareStatus + [-SubscriptionId ] [-Description ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates the file share. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AdminUser +The user/group who will have full permission in this share. +Active directory email address. +Example: xyz@contoso.com or Contoso\xyz. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DataPolicy +The data policy + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +Description for file share + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileServerName +The file server name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MonitoringStatus +The monitoring status + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProvisionedCapacityInByte +The total provisioned capacity in Bytes + +```yaml +Type: System.Int64 +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShareName +The file share name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShareStatus +The Share Status + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/New-AzStorSimpleIscsiDisk.md b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleIscsiDisk.md new file mode 100644 index 000000000000..5db5b7574601 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleIscsiDisk.md @@ -0,0 +1,322 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpleiscsidisk +schema: 2.0.0 +--- + +# New-AzStorSimpleIscsiDisk + +## SYNOPSIS +Creates or updates the iSCSI disk. + +## SYNTAX + +``` +New-AzStorSimpleIscsiDisk -DeviceName -DiskName -IscsiServerName + -ManagerName -ResourceGroupName -AccessControlRecord -DataPolicy + -DiskStatus -MonitoringStatus -ProvisionedCapacityInByte + [-SubscriptionId ] [-Description ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates the iSCSI disk. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccessControlRecord +The access control records. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DataPolicy +The data policy. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +The description. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskName +The disk name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskStatus +The disk status. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IscsiServerName +The iSCSI server name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MonitoringStatus +The monitoring. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProvisionedCapacityInByte +The provisioned capacity in bytes. + +```yaml +Type: System.Int64 +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/New-AzStorSimpleIscsiServer.md b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleIscsiServer.md new file mode 100644 index 000000000000..be7f646f0ad8 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleIscsiServer.md @@ -0,0 +1,291 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpleiscsiserver +schema: 2.0.0 +--- + +# New-AzStorSimpleIscsiServer + +## SYNOPSIS +Creates or updates the iSCSI server. + +## SYNTAX + +``` +New-AzStorSimpleIscsiServer -DeviceName -ManagerName -Name + -ResourceGroupName -BackupScheduleGroupId -StorageDomainId + [-SubscriptionId ] [-ChapId ] [-Description ] [-ReverseChapId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates the iSCSI server. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BackupScheduleGroupId +The backup policy id. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ChapId +The chap id. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +The description. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The iSCSI server name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: IscsiServerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ReverseChapId +The reverse chap id. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageDomainId +The storage domain id. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/New-AzStorSimpleManager.md b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleManager.md new file mode 100644 index 000000000000..05b0a21e3144 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleManager.md @@ -0,0 +1,215 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplemanager +schema: 2.0.0 +--- + +# New-AzStorSimpleManager + +## SYNOPSIS +Creates or updates the manager. + +## SYNTAX + +``` +New-AzStorSimpleManager -Name -ResourceGroupName -Location + [-SubscriptionId ] [-CiIntrinsicSettingType ] [-Etag ] [-Tag ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates the manager. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -CiIntrinsicSettingType +Refers to the type of the StorSimple Manager + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +ETag of the Manager + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The Geo location of the Manager + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ManagerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Tags attached to the Manager + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/New-AzStorSimpleManagerExtendedInfo.md b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleManagerExtendedInfo.md new file mode 100644 index 000000000000..3f89a4910f83 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleManagerExtendedInfo.md @@ -0,0 +1,263 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplemanagerextendedinfo +schema: 2.0.0 +--- + +# New-AzStorSimpleManagerExtendedInfo + +## SYNOPSIS +Creates the extended info of the manager. + +## SYNTAX + +``` +New-AzStorSimpleManagerExtendedInfo -ManagerName -ResourceGroupName -Algorithm + -IntegrityKey [-SubscriptionId ] [-EncryptionKey ] + [-EncryptionKeyThumbprint ] [-Etag ] [-PortalCertificateThumbprint ] + [-Version ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates the extended info of the manager. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -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 + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptionKey +Represents the CEK of the resource + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptionKeyThumbprint +Represents the Cert thumbprint that was used to encrypt the CEK + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +ETag of the Resource + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IntegrityKey +Represents the CIK of the resource + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PortalCertificateThumbprint +Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Version +Represents the version of the ExtendedInfo object being persisted + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/New-AzStorSimpleStorageAccountCredentials.md b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleStorageAccountCredentials.md new file mode 100644 index 000000000000..69094b08ce81 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleStorageAccountCredentials.md @@ -0,0 +1,323 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplestorageaccountcredentials +schema: 2.0.0 +--- + +# New-AzStorSimpleStorageAccountCredentials + +## SYNOPSIS +Creates or updates the storage account credential + +## SYNTAX + +``` +New-AzStorSimpleStorageAccountCredentials -CredentialName -ManagerName + -ResourceGroupName -CloudType -EnableSsl -EndPoint -Login + [-SubscriptionId ] [-AccessKeyEncryptionAlgorithm ] + [-AccessKeyEncryptionCertificateThumbprint ] [-AccessKeyValue ] [-Location ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates the storage account credential + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccessKeyEncryptionAlgorithm +Algorithm used to encrypt "Value" + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AccessKeyEncryptionCertificateThumbprint +Thumbprint certificate that was used to encrypt "Value" + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AccessKeyValue +The value of the secret itself. +If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CloudType +The cloud service provider + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CredentialName +The credential name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnableSsl +SSL needs to be enabled or not + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndPoint +The storage endpoint + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The storage account's geo location + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Login +The storage account login + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/New-AzStorSimpleStorageDomain.md b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleStorageDomain.md new file mode 100644 index 000000000000..8358f42a89a6 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/New-AzStorSimpleStorageDomain.md @@ -0,0 +1,278 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplestoragedomain +schema: 2.0.0 +--- + +# New-AzStorSimpleStorageDomain + +## SYNOPSIS +Creates or updates the storage domain. + +## SYNTAX + +``` +New-AzStorSimpleStorageDomain -ManagerName -Name -ResourceGroupName + -EncryptionStatus -StorageAccountCredentialId [-SubscriptionId ] + [-EncryptionKeyEncryptionAlgorithm ] + [-EncryptionKeyEncryptionCertificateThumbprint ] [-EncryptionKeyValue ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates the storage domain. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptionKeyEncryptionAlgorithm +Algorithm used to encrypt "Value" + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptionKeyEncryptionCertificateThumbprint +Thumbprint certificate that was used to encrypt "Value" + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptionKeyValue +The value of the secret itself. +If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptionStatus +The encryption status "Enabled | Disabled". + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The storage domain name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: StorageDomainName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageAccountCredentialId +The storage account credentials. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/README.md b/swaggerci/storSimple1200Series/docs/README.md new file mode 100644 index 000000000000..4c5784ea8dc1 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/README.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.StorSimple` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `../examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.StorSimple` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `../exports` folder. Additionally, when writing custom cmdlets in the `../custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `../examples` folder. \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleAccessControlRecord.md b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleAccessControlRecord.md new file mode 100644 index 000000000000..1e6334c9e77c --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleAccessControlRecord.md @@ -0,0 +1,265 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimpleaccesscontrolrecord +schema: 2.0.0 +--- + +# Remove-AzStorSimpleAccessControlRecord + +## SYNOPSIS +Deletes the access control record. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorSimpleAccessControlRecord -ManagerName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorSimpleAccessControlRecord -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the access control record. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the access control record to delete. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: AccessControlRecordName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleBackup.md b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleBackup.md new file mode 100644 index 000000000000..e9b2b3c8620c --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleBackup.md @@ -0,0 +1,280 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplebackup +schema: 2.0.0 +--- + +# Remove-AzStorSimpleBackup + +## SYNOPSIS +Deletes the backup. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorSimpleBackup -DeviceName -ManagerName -Name + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorSimpleBackup -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the backup. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The backup name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: BackupName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleBackupScheduleGroup.md b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleBackupScheduleGroup.md new file mode 100644 index 000000000000..2d4184d14da1 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleBackupScheduleGroup.md @@ -0,0 +1,280 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplebackupschedulegroup +schema: 2.0.0 +--- + +# Remove-AzStorSimpleBackupScheduleGroup + +## SYNOPSIS +Deletes the backup schedule group. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorSimpleBackupScheduleGroup -DeviceName -ManagerName -ResourceGroupName + -ScheduleGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorSimpleBackupScheduleGroup -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the backup schedule group. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The name of the device. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScheduleGroupName +The name of the schedule group. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleChapSetting.md b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleChapSetting.md new file mode 100644 index 000000000000..bcf2ab278cb8 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleChapSetting.md @@ -0,0 +1,280 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplechapsetting +schema: 2.0.0 +--- + +# Remove-AzStorSimpleChapSetting + +## SYNOPSIS +Deletes the chap setting. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorSimpleChapSetting -ChapUserName -DeviceName -ManagerName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorSimpleChapSetting -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the chap setting. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ChapUserName +The chap user name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleDevice.md b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleDevice.md new file mode 100644 index 000000000000..3db265a0b875 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleDevice.md @@ -0,0 +1,265 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimpledevice +schema: 2.0.0 +--- + +# Remove-AzStorSimpleDevice + +## SYNOPSIS +Deletes the device. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorSimpleDevice -ManagerName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorSimpleDevice -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the device. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The device name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: DeviceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleFileServer.md b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleFileServer.md new file mode 100644 index 000000000000..aa649a483a02 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleFileServer.md @@ -0,0 +1,280 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplefileserver +schema: 2.0.0 +--- + +# Remove-AzStorSimpleFileServer + +## SYNOPSIS +Deletes the file server. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorSimpleFileServer -DeviceName -ManagerName -Name + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorSimpleFileServer -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the file server. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The file server name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: FileServerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleFileShare.md b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleFileShare.md new file mode 100644 index 000000000000..81f0de77bf5d --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleFileShare.md @@ -0,0 +1,295 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplefileshare +schema: 2.0.0 +--- + +# Remove-AzStorSimpleFileShare + +## SYNOPSIS +Deletes the file share. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorSimpleFileShare -DeviceName -FileServerName -ManagerName + -ResourceGroupName -ShareName [-SubscriptionId ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorSimpleFileShare -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the file share. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileServerName +The file server name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShareName +The file share Name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleIscsiDisk.md b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleIscsiDisk.md new file mode 100644 index 000000000000..e21bba9ef40b --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleIscsiDisk.md @@ -0,0 +1,295 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimpleiscsidisk +schema: 2.0.0 +--- + +# Remove-AzStorSimpleIscsiDisk + +## SYNOPSIS +Deletes the iSCSI disk. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorSimpleIscsiDisk -DeviceName -DiskName -IscsiServerName + -ManagerName -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorSimpleIscsiDisk -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the iSCSI disk. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskName +The disk name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -IscsiServerName +The iSCSI server name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleIscsiServer.md b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleIscsiServer.md new file mode 100644 index 000000000000..fb0de285516a --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleIscsiServer.md @@ -0,0 +1,280 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimpleiscsiserver +schema: 2.0.0 +--- + +# Remove-AzStorSimpleIscsiServer + +## SYNOPSIS +Deletes the iSCSI server. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorSimpleIscsiServer -DeviceName -ManagerName -Name + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorSimpleIscsiServer -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the iSCSI server. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The iSCSI server name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: IscsiServerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleManager.md b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleManager.md new file mode 100644 index 000000000000..0ea6943af4b0 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleManager.md @@ -0,0 +1,219 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplemanager +schema: 2.0.0 +--- + +# Remove-AzStorSimpleManager + +## SYNOPSIS +Deletes the manager. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorSimpleManager -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorSimpleManager -InputObject [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the manager. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The manager name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: ManagerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleManagerExtendedInfo.md b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleManagerExtendedInfo.md new file mode 100644 index 000000000000..8cbfcb4c4182 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleManagerExtendedInfo.md @@ -0,0 +1,219 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplemanagerextendedinfo +schema: 2.0.0 +--- + +# Remove-AzStorSimpleManagerExtendedInfo + +## SYNOPSIS +Deletes the extended info of the manager. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorSimpleManagerExtendedInfo -ManagerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorSimpleManagerExtendedInfo -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the extended info of the manager. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleStorageAccountCredentials.md b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleStorageAccountCredentials.md new file mode 100644 index 000000000000..c1a42a1cb00a --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleStorageAccountCredentials.md @@ -0,0 +1,265 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplestorageaccountcredentials +schema: 2.0.0 +--- + +# Remove-AzStorSimpleStorageAccountCredentials + +## SYNOPSIS +Deletes the storage account credential + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorSimpleStorageAccountCredentials -CredentialName -ManagerName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorSimpleStorageAccountCredentials -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the storage account credential + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CredentialName +The name of the storage account credential. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleStorageDomain.md b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleStorageDomain.md new file mode 100644 index 000000000000..6c9f2e2cd721 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Remove-AzStorSimpleStorageDomain.md @@ -0,0 +1,265 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplestoragedomain +schema: 2.0.0 +--- + +# Remove-AzStorSimpleStorageDomain + +## SYNOPSIS +Deletes the storage domain. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorSimpleStorageDomain -ManagerName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorSimpleStorageDomain -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the storage domain. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The storage domain name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: StorageDomainName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Send-AzStorSimpleAlertTestEmail.md b/swaggerci/storSimple1200Series/docs/Send-AzStorSimpleAlertTestEmail.md new file mode 100644 index 000000000000..9a534533b7ed --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Send-AzStorSimpleAlertTestEmail.md @@ -0,0 +1,284 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/send-azstorsimplealerttestemail +schema: 2.0.0 +--- + +# Send-AzStorSimpleAlertTestEmail + +## SYNOPSIS +Sends a test alert email. + +## SYNTAX + +### SendExpanded (Default) +``` +Send-AzStorSimpleAlertTestEmail -DeviceName -ManagerName -ResourceGroupName + -EmailList [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### Send +``` +Send-AzStorSimpleAlertTestEmail -DeviceName -ManagerName -ResourceGroupName + -Request [-SubscriptionId ] [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### SendViaIdentity +``` +Send-AzStorSimpleAlertTestEmail -InputObject -Request + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### SendViaIdentityExpanded +``` +Send-AzStorSimpleAlertTestEmail -InputObject -EmailList + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Sends a test alert email. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: Send, SendExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EmailList +List of emails to send the test alerts + +```yaml +Type: System.String[] +Parameter Sets: SendExpanded, SendViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: SendViaIdentity, SendViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Send, SendExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Request +Request for sending test alert email +To construct, see NOTES section for REQUEST properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest +Parameter Sets: Send, SendViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Send, SendExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Send, SendExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +REQUEST : Request for sending test alert email + - `EmailList `: List of emails to send the test alerts + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Update-AzStorSimpleDevice.md b/swaggerci/storSimple1200Series/docs/Update-AzStorSimpleDevice.md new file mode 100644 index 000000000000..7c1e3c14c3af --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Update-AzStorSimpleDevice.md @@ -0,0 +1,300 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/update-azstorsimpledevice +schema: 2.0.0 +--- + +# Update-AzStorSimpleDevice + +## SYNOPSIS +Patches the device. + +## SYNTAX + +### PatchExpanded (Default) +``` +Update-AzStorSimpleDevice -ManagerName -Name -ResourceGroupName + [-SubscriptionId ] [-DeviceDescription ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-Confirm] [-WhatIf] [] +``` + +### Patch +``` +Update-AzStorSimpleDevice -ManagerName -Name -ResourceGroupName + -DevicePatch [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-Confirm] [-WhatIf] [] +``` + +### PatchViaIdentity +``` +Update-AzStorSimpleDevice -InputObject -DevicePatch + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### PatchViaIdentityExpanded +``` +Update-AzStorSimpleDevice -InputObject [-DeviceDescription ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Patches the device. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceDescription +Short description given for the device + +```yaml +Type: System.String +Parameter Sets: PatchExpanded, PatchViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DevicePatch +Class that represents the Input for the PATCH call on Device. +Currently the only patchable property on device is "DeviceDescription" +To construct, see NOTES section for DEVICEPATCH properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch +Parameter Sets: Patch, PatchViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: PatchViaIdentity, PatchViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: Patch, PatchExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The device Name. + +```yaml +Type: System.String +Parameter Sets: Patch, PatchExpanded +Aliases: DeviceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: Patch, PatchExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: Patch, PatchExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +DEVICEPATCH : Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" + - `[DeviceDescription ]`: Short description given for the device + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Update-AzStorSimpleDeviceSecuritySetting.md b/swaggerci/storSimple1200Series/docs/Update-AzStorSimpleDeviceSecuritySetting.md new file mode 100644 index 000000000000..354dbda3144a --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Update-AzStorSimpleDeviceSecuritySetting.md @@ -0,0 +1,315 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/update-azstorsimpledevicesecuritysetting +schema: 2.0.0 +--- + +# Update-AzStorSimpleDeviceSecuritySetting + +## SYNOPSIS +Creates or updates the security settings. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzStorSimpleDeviceSecuritySetting -DeviceName -ManagerName + -ResourceGroupName -DeviceAdminPasswordEncryptionAlgorithm + -DeviceAdminPasswordValue [-SubscriptionId ] + [-DeviceAdminPasswordEncryptionCertificateThumbprint ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzStorSimpleDeviceSecuritySetting -InputObject + -DeviceAdminPasswordEncryptionAlgorithm -DeviceAdminPasswordValue + [-DeviceAdminPasswordEncryptionCertificateThumbprint ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates the security settings. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceAdminPasswordEncryptionAlgorithm +Algorithm used to encrypt "Value" + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceAdminPasswordEncryptionCertificateThumbprint +Thumbprint certificate that was used to encrypt "Value" + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceAdminPasswordValue +The value of the secret itself. +If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeviceName +The device name. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Update-AzStorSimpleManager.md b/swaggerci/storSimple1200Series/docs/Update-AzStorSimpleManager.md new file mode 100644 index 000000000000..de29e95d96d2 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Update-AzStorSimpleManager.md @@ -0,0 +1,219 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/update-azstorsimplemanager +schema: 2.0.0 +--- + +# Update-AzStorSimpleManager + +## SYNOPSIS +Updates the StorSimple Manager. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzStorSimpleManager -Name -ResourceGroupName [-SubscriptionId ] + [-Tag ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzStorSimpleManager -InputObject [-Tag ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Updates the StorSimple Manager. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The manager name + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: ManagerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +The tags attached to the StorSimple Manager. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/docs/Update-AzStorSimpleManagerExtendedInfo.md b/swaggerci/storSimple1200Series/docs/Update-AzStorSimpleManagerExtendedInfo.md new file mode 100644 index 000000000000..f5b669604c68 --- /dev/null +++ b/swaggerci/storSimple1200Series/docs/Update-AzStorSimpleManagerExtendedInfo.md @@ -0,0 +1,330 @@ +--- +external help file: +Module Name: Az.StorSimple +online version: https://docs.microsoft.com/en-us/powershell/module/az.storsimple/update-azstorsimplemanagerextendedinfo +schema: 2.0.0 +--- + +# Update-AzStorSimpleManagerExtendedInfo + +## SYNOPSIS +Updates the extended info of the manager. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzStorSimpleManagerExtendedInfo -ManagerName -ResourceGroupName -IfMatch + -Algorithm -IntegrityKey [-SubscriptionId ] [-EncryptionKey ] + [-EncryptionKeyThumbprint ] [-Etag ] [-PortalCertificateThumbprint ] + [-Version ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzStorSimpleManagerExtendedInfo -InputObject -IfMatch + -Algorithm -IntegrityKey [-EncryptionKey ] [-EncryptionKeyThumbprint ] + [-Etag ] [-PortalCertificateThumbprint ] [-Version ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Updates the extended info of the manager. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -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 + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptionKey +Represents the CEK of the resource + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptionKeyThumbprint +Represents the Cert thumbprint that was used to encrypt the CEK + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Etag +ETag of the Resource + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfMatch +Pass the ETag of ExtendedInfo fetched from GET call + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -IntegrityKey +Represents the CIK of the resource + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagerName +The manager name + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PortalCertificateThumbprint +Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The subscription id + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Version +Represents the version of the ExtendedInfo object being persisted + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AccessControlRecordName ]`: Name of access control record to be fetched. + - `[BackupName ]`: The backup name. + - `[CertificateName ]`: Certificate Name + - `[ChapUserName ]`: The user name of chap to be fetched. + - `[CredentialName ]`: The name of storage account credential to be fetched. + - `[DeviceName ]`: The device name. + - `[DiskName ]`: The disk name. + - `[ElementName ]`: The backup element name. + - `[FileServerName ]`: The file server name. + - `[Id ]`: Resource identity path + - `[IscsiServerName ]`: The iSCSI server name. + - `[JobName ]`: The job name. + - `[ManagerName ]`: The manager name + - `[ResourceGroupName ]`: The resource group name + - `[ScheduleGroupName ]`: The name of the schedule group. + - `[ShareName ]`: The file share name. + - `[StorageDomainName ]`: The storage domain name. + - `[SubscriptionId ]`: The subscription id + +## RELATED LINKS + diff --git a/swaggerci/storSimple1200Series/examples/Backup-AzStorSimpleFileServerNow.md b/swaggerci/storSimple1200Series/examples/Backup-AzStorSimpleFileServerNow.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Backup-AzStorSimpleFileServerNow.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Backup-AzStorSimpleIscsiServerNow.md b/swaggerci/storSimple1200Series/examples/Backup-AzStorSimpleIscsiServerNow.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Backup-AzStorSimpleIscsiServerNow.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Clear-AzStorSimpleAlert.md b/swaggerci/storSimple1200Series/examples/Clear-AzStorSimpleAlert.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Clear-AzStorSimpleAlert.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Copy-AzStorSimpleBackup.md b/swaggerci/storSimple1200Series/examples/Copy-AzStorSimpleBackup.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Copy-AzStorSimpleBackup.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleAccessControlRecord.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleAccessControlRecord.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleAccessControlRecord.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleAlert.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleAlert.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleAlert.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleAvailableProviderOperation.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleAvailableProviderOperation.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleAvailableProviderOperation.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleBackup.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleBackup.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleBackup.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleBackupScheduleGroup.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleBackupScheduleGroup.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleBackupScheduleGroup.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleChapSetting.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleChapSetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleChapSetting.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDevice.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDevice.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDevice.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceAlertSetting.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceAlertSetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceAlertSetting.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceFailoverTarget.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceFailoverTarget.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceFailoverTarget.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceMetric.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceMetric.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceMetric.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceMetricDefinition.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceMetricDefinition.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceMetricDefinition.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceNetworkSetting.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceNetworkSetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceNetworkSetting.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceTimeSetting.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceTimeSetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceTimeSetting.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceUpdateSummary.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceUpdateSummary.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleDeviceUpdateSummary.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileServer.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileServer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileServer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileServerMetric.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileServerMetric.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileServerMetric.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileServerMetricDefinition.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileServerMetricDefinition.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileServerMetricDefinition.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileShare.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileShare.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileShareMetric.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileShareMetric.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileShareMetric.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileShareMetricDefinition.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileShareMetricDefinition.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleFileShareMetricDefinition.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiDisk.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiDisk.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiDisk.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiDiskMetric.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiDiskMetric.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiDiskMetric.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiDiskMetricDefinition.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiDiskMetricDefinition.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiDiskMetricDefinition.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiServer.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiServer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiServer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiServerMetric.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiServerMetric.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiServerMetric.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiServerMetricDefinition.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiServerMetricDefinition.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleIscsiServerMetricDefinition.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleJob.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleJob.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleJob.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManager.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManager.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManager.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerEncryptionKey.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerEncryptionKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerEncryptionKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerEncryptionSetting.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerEncryptionSetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerEncryptionSetting.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerExtendedInfo.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerExtendedInfo.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerExtendedInfo.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerMetric.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerMetric.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerMetric.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerMetricDefinition.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerMetricDefinition.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleManagerMetricDefinition.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleStorageAccountCredentials.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleStorageAccountCredentials.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleStorageAccountCredentials.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleStorageDomain.md b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleStorageDomain.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Get-AzStorSimpleStorageDomain.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Install-AzStorSimpleDeviceUpdate.md b/swaggerci/storSimple1200Series/examples/Install-AzStorSimpleDeviceUpdate.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Install-AzStorSimpleDeviceUpdate.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Invoke-AzStorSimpleDeactivateDevice.md b/swaggerci/storSimple1200Series/examples/Invoke-AzStorSimpleDeactivateDevice.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Invoke-AzStorSimpleDeactivateDevice.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Invoke-AzStorSimpleDownloadDeviceUpdate.md b/swaggerci/storSimple1200Series/examples/Invoke-AzStorSimpleDownloadDeviceUpdate.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Invoke-AzStorSimpleDownloadDeviceUpdate.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Invoke-AzStorSimpleScanDevice.md b/swaggerci/storSimple1200Series/examples/Invoke-AzStorSimpleScanDevice.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Invoke-AzStorSimpleScanDevice.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Invoke-AzStorSimpleUploadManagerRegistrationCertificate.md b/swaggerci/storSimple1200Series/examples/Invoke-AzStorSimpleUploadManagerRegistrationCertificate.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Invoke-AzStorSimpleUploadManagerRegistrationCertificate.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/New-AzStorSimpleAccessControlRecord.md b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleAccessControlRecord.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleAccessControlRecord.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/New-AzStorSimpleBackupScheduleGroup.md b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleBackupScheduleGroup.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleBackupScheduleGroup.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/New-AzStorSimpleChapSetting.md b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleChapSetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleChapSetting.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/New-AzStorSimpleDeviceAlertSetting.md b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleDeviceAlertSetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleDeviceAlertSetting.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/New-AzStorSimpleDeviceSecuritySetting.md b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleDeviceSecuritySetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleDeviceSecuritySetting.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/New-AzStorSimpleFileServer.md b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleFileServer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleFileServer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/New-AzStorSimpleFileShare.md b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleFileShare.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/New-AzStorSimpleIscsiDisk.md b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleIscsiDisk.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleIscsiDisk.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/New-AzStorSimpleIscsiServer.md b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleIscsiServer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleIscsiServer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/New-AzStorSimpleManager.md b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleManager.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleManager.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/New-AzStorSimpleManagerExtendedInfo.md b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleManagerExtendedInfo.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleManagerExtendedInfo.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/New-AzStorSimpleStorageAccountCredentials.md b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleStorageAccountCredentials.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleStorageAccountCredentials.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/New-AzStorSimpleStorageDomain.md b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleStorageDomain.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/New-AzStorSimpleStorageDomain.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleAccessControlRecord.md b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleAccessControlRecord.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleAccessControlRecord.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleBackup.md b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleBackup.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleBackup.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleBackupScheduleGroup.md b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleBackupScheduleGroup.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleBackupScheduleGroup.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleChapSetting.md b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleChapSetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleChapSetting.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleDevice.md b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleDevice.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleDevice.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleFileServer.md b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleFileServer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleFileServer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleFileShare.md b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleFileShare.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleIscsiDisk.md b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleIscsiDisk.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleIscsiDisk.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleIscsiServer.md b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleIscsiServer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleIscsiServer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleManager.md b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleManager.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleManager.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleManagerExtendedInfo.md b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleManagerExtendedInfo.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleManagerExtendedInfo.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleStorageAccountCredentials.md b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleStorageAccountCredentials.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleStorageAccountCredentials.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleStorageDomain.md b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleStorageDomain.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Remove-AzStorSimpleStorageDomain.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Send-AzStorSimpleAlertTestEmail.md b/swaggerci/storSimple1200Series/examples/Send-AzStorSimpleAlertTestEmail.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Send-AzStorSimpleAlertTestEmail.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Update-AzStorSimpleDevice.md b/swaggerci/storSimple1200Series/examples/Update-AzStorSimpleDevice.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Update-AzStorSimpleDevice.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Update-AzStorSimpleDeviceSecuritySetting.md b/swaggerci/storSimple1200Series/examples/Update-AzStorSimpleDeviceSecuritySetting.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Update-AzStorSimpleDeviceSecuritySetting.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Update-AzStorSimpleManager.md b/swaggerci/storSimple1200Series/examples/Update-AzStorSimpleManager.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Update-AzStorSimpleManager.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/examples/Update-AzStorSimpleManagerExtendedInfo.md b/swaggerci/storSimple1200Series/examples/Update-AzStorSimpleManagerExtendedInfo.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storSimple1200Series/examples/Update-AzStorSimpleManagerExtendedInfo.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storSimple1200Series/export-surface.ps1 b/swaggerci/storSimple1200Series/export-surface.ps1 new file mode 100644 index 000000000000..6d0e517e687b --- /dev/null +++ b/swaggerci/storSimple1200Series/export-surface.ps1 @@ -0,0 +1,33 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.StorSimple.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} +$null = Import-Module -Name $dll + +$moduleName = 'Az.StorSimple' +$exportsFolder = Join-Path $PSScriptRoot 'exports' +$resourcesFolder = Join-Path $PSScriptRoot 'resources' + +Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'" + +Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'" + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/exports/Backup-AzStorSimpleFileServerNow.ps1 b/swaggerci/storSimple1200Series/exports/Backup-AzStorSimpleFileServerNow.ps1 new file mode 100644 index 000000000000..449f1478f88e --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Backup-AzStorSimpleFileServerNow.ps1 @@ -0,0 +1,234 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Backup the file server now. +.Description +Backup the file server now. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/backup-azstorsimplefileservernow +#> +function Backup-AzStorSimpleFileServerNow { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Backup', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${FileServerName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Backup')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='BackupViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Backup = 'Az.StorSimple.private\Backup-AzStorSimpleFileServerNow_Backup'; + BackupViaIdentity = 'Az.StorSimple.private\Backup-AzStorSimpleFileServerNow_BackupViaIdentity'; + } + if (('Backup') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Backup-AzStorSimpleIscsiServerNow.ps1 b/swaggerci/storSimple1200Series/exports/Backup-AzStorSimpleIscsiServerNow.ps1 new file mode 100644 index 000000000000..0d2717064f66 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Backup-AzStorSimpleIscsiServerNow.ps1 @@ -0,0 +1,234 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Backup the iSCSI server now. +.Description +Backup the iSCSI server now. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/backup-azstorsimpleiscsiservernow +#> +function Backup-AzStorSimpleIscsiServerNow { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Backup', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Backup')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='BackupViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Backup = 'Az.StorSimple.private\Backup-AzStorSimpleIscsiServerNow_Backup'; + BackupViaIdentity = 'Az.StorSimple.private\Backup-AzStorSimpleIscsiServerNow_BackupViaIdentity'; + } + if (('Backup') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Clear-AzStorSimpleAlert.ps1 b/swaggerci/storSimple1200Series/exports/Clear-AzStorSimpleAlert.ps1 new file mode 100644 index 000000000000..48710b07a10a --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Clear-AzStorSimpleAlert.ps1 @@ -0,0 +1,245 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Clear the alerts. +.Description +Clear the alerts. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id + +REQUEST : Request for clearing the alert + Alert : List of alert Ids to be cleared + [ResolutionMessage ]: Resolution message while clearing the request +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/clear-azstorsimplealert +#> +function Clear-AzStorSimpleAlert { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='ClearExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Clear', Mandatory)] + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Clear', Mandatory)] + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Clear')] + [Parameter(ParameterSetName='ClearExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='ClearViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ClearViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Clear', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ClearViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest] + # Request for clearing the alert + # To construct, see NOTES section for REQUEST properties and create a hash table. + ${Request}, + + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Parameter(ParameterSetName='ClearViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String[]] + # List of alert Ids to be cleared + ${Alert}, + + [Parameter(ParameterSetName='ClearExpanded')] + [Parameter(ParameterSetName='ClearViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Resolution message while clearing the request + ${ResolutionMessage}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Clear = 'Az.StorSimple.private\Clear-AzStorSimpleAlert_Clear'; + ClearExpanded = 'Az.StorSimple.private\Clear-AzStorSimpleAlert_ClearExpanded'; + ClearViaIdentity = 'Az.StorSimple.private\Clear-AzStorSimpleAlert_ClearViaIdentity'; + ClearViaIdentityExpanded = 'Az.StorSimple.private\Clear-AzStorSimpleAlert_ClearViaIdentityExpanded'; + } + if (('Clear', 'ClearExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Copy-AzStorSimpleBackup.ps1 b/swaggerci/storSimple1200Series/exports/Copy-AzStorSimpleBackup.ps1 new file mode 100644 index 000000000000..602e76a6ffd3 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Copy-AzStorSimpleBackup.ps1 @@ -0,0 +1,391 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Clones the given backup element to a new disk or share with given details. +.Description +Clones the given backup element to a new disk or share with given details. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CLONEREQUEST : Clone Job Request Model. + NewEndpointName : Name of new endpoint which will created as part of clone job. + TargetAccessPointId : Access point Id on which clone job will performed. + TargetDeviceId : DeviceId of the device which will act as the Clone target + [AccessControlRecord ]: The access control records. + [AdminUser ]: The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\xyz. + [DiskPropertiesDataPolicy ]: The data policy. + [DiskPropertiesDescription ]: The description. + [DiskPropertiesMonitoringStatus ]: The monitoring. + [DiskPropertiesProvisionedCapacityInByte ]: The provisioned capacity in bytes. + [DiskStatus ]: The disk status. + [SharePropertiesDataPolicy ]: The data policy + [SharePropertiesDescription ]: Description for file share + [SharePropertiesMonitoringStatus ]: The monitoring status + [SharePropertiesProvisionedCapacityInByte ]: The total provisioned capacity in Bytes + [ShareStatus ]: The Share Status + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/copy-azstorsimplebackup +#> +function Copy-AzStorSimpleBackup { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CloneExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Clone', Mandatory)] + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Clone', Mandatory)] + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The backup element name. + ${ElementName}, + + [Parameter(ParameterSetName='Clone', Mandatory)] + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Clone', Mandatory)] + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Alias('BackupName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The backup name. + ${Name}, + + [Parameter(ParameterSetName='Clone', Mandatory)] + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Clone')] + [Parameter(ParameterSetName='CloneExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='CloneViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CloneViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Clone', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CloneViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest] + # Clone Job Request Model. + # To construct, see NOTES section for CLONEREQUEST properties and create a hash table. + ${CloneRequest}, + + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Parameter(ParameterSetName='CloneViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Name of new endpoint which will created as part of clone job. + ${NewEndpointName}, + + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Parameter(ParameterSetName='CloneViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Access point Id on which clone job will performed. + ${TargetAccessPointId}, + + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Parameter(ParameterSetName='CloneViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # DeviceId of the device which will act as the Clone target + ${TargetDeviceId}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String[]] + # The access control records. + ${AccessControlRecord}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The user/group who will have full permission in this share. + # Active directory email address. + # Example: xyz@contoso.com or Contoso\xyz. + ${AdminUser}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy] + # The data policy. + ${DiskPropertiesDataPolicy}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The description. + ${DiskPropertiesDescription}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus] + # The monitoring. + ${DiskPropertiesMonitoringStatus}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.Int64] + # The provisioned capacity in bytes. + ${DiskPropertiesProvisionedCapacityInByte}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus] + # The disk status. + ${DiskStatus}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy] + # The data policy + ${SharePropertiesDataPolicy}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Description for file share + ${SharePropertiesDescription}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus] + # The monitoring status + ${SharePropertiesMonitoringStatus}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.Int64] + # The total provisioned capacity in Bytes + ${SharePropertiesProvisionedCapacityInByte}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus] + # The Share Status + ${ShareStatus}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Clone = 'Az.StorSimple.private\Copy-AzStorSimpleBackup_Clone'; + CloneExpanded = 'Az.StorSimple.private\Copy-AzStorSimpleBackup_CloneExpanded'; + CloneViaIdentity = 'Az.StorSimple.private\Copy-AzStorSimpleBackup_CloneViaIdentity'; + CloneViaIdentityExpanded = 'Az.StorSimple.private\Copy-AzStorSimpleBackup_CloneViaIdentityExpanded'; + } + if (('Clone', 'CloneExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleAccessControlRecord.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleAccessControlRecord.ps1 new file mode 100644 index 000000000000..605e6f5eb2cb --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleAccessControlRecord.ps1 @@ -0,0 +1,215 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties of the specified access control record name. +.Description +Returns the properties of the specified access control record name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleaccesscontrolrecord +#> +function Get-AzStorSimpleAccessControlRecord { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('AccessControlRecordName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # Name of access control record to be fetched. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleAccessControlRecord_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleAccessControlRecord_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleAccessControlRecord_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleAlert.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleAlert.ps1 new file mode 100644 index 000000000000..bc4ec9ed5282 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleAlert.ps1 @@ -0,0 +1,176 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieves all the alerts in a manager. +.Description +Retrieves all the alerts in a manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplealert +#> +function Get-AzStorSimpleAlert { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleAlert_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleAvailableProviderOperation.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleAvailableProviderOperation.ps1 new file mode 100644 index 000000000000..e177d50c156e --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleAvailableProviderOperation.ps1 @@ -0,0 +1,148 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List of AvailableProviderOperations +.Description +List of AvailableProviderOperations +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleavailableprovideroperation +#> +function Get-AzStorSimpleAvailableProviderOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleAvailableProviderOperation_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleBackup.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleBackup.ps1 new file mode 100644 index 000000000000..b97135c1d6f4 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleBackup.ps1 @@ -0,0 +1,189 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieves all the backups in a manager. +.Description +Retrieves all the backups in a manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplebackup +#> +function Get-AzStorSimpleBackup { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Set to true if you need backups which can be used for failover. + ${ForFailover}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleBackup_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleBackup_List1'; + } + if (('List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleBackupScheduleGroup.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleBackupScheduleGroup.ps1 new file mode 100644 index 000000000000..502c75d14496 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleBackupScheduleGroup.ps1 @@ -0,0 +1,221 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties of the specified backup schedule group name. +.Description +Returns the properties of the specified backup schedule group name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplebackupschedulegroup +#> +function Get-AzStorSimpleBackupScheduleGroup { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the device. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the schedule group. + ${ScheduleGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleBackupScheduleGroup_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleBackupScheduleGroup_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleBackupScheduleGroup_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleChapSetting.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleChapSetting.ps1 new file mode 100644 index 000000000000..427486ff5880 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleChapSetting.ps1 @@ -0,0 +1,221 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties of the specified chap setting name. +.Description +Returns the properties of the specified chap setting name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplechapsetting +#> +function Get-AzStorSimpleChapSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The user name of chap to be fetched. + ${ChapUserName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleChapSetting_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleChapSetting_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleChapSetting_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDevice.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDevice.ps1 new file mode 100644 index 000000000000..91fefbaf0307 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDevice.ps1 @@ -0,0 +1,221 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties of the specified device name. +.Description +Returns the properties of the specified device name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevice +#> +function Get-AzStorSimpleDevice { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # Specify $expand=details to populate additional fields related to the device. + ${Expand}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleDevice_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleDevice_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleDevice_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceAlertSetting.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceAlertSetting.ps1 new file mode 100644 index 000000000000..a06b5f373a17 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceAlertSetting.ps1 @@ -0,0 +1,210 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the alert settings of the specified device name. +.Description +Returns the alert settings of the specified device name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicealertsetting +#> +function Get-AzStorSimpleDeviceAlertSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleDeviceAlertSetting_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleDeviceAlertSetting_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceFailoverTarget.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceFailoverTarget.ps1 new file mode 100644 index 000000000000..3b2d7e92439f --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceFailoverTarget.ps1 @@ -0,0 +1,182 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieves all the devices which can be used as failover targets for the given device. +.Description +Retrieves all the devices which can be used as failover targets for the given device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicefailovertarget +#> +function Get-AzStorSimpleDeviceFailoverTarget { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # Specify $expand=details to populate additional fields related to the device. + ${Expand}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleDeviceFailoverTarget_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceMetric.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceMetric.ps1 new file mode 100644 index 000000000000..4ce2f76c5b40 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceMetric.ps1 @@ -0,0 +1,182 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieves the device metrics. +.Description +Retrieves the device metrics. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicemetric +#> +function Get-AzStorSimpleDeviceMetric { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the appliance. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleDeviceMetric_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceMetricDefinition.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceMetricDefinition.ps1 new file mode 100644 index 000000000000..5d13b90abb35 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceMetricDefinition.ps1 @@ -0,0 +1,176 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieves metric definition of all metrics aggregated at device. +.Description +Retrieves metric definition of all metrics aggregated at device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicemetricdefinition +#> +function Get-AzStorSimpleDeviceMetricDefinition { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the appliance. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleDeviceMetricDefinition_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceNetworkSetting.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceNetworkSetting.ps1 new file mode 100644 index 000000000000..f02887458840 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceNetworkSetting.ps1 @@ -0,0 +1,210 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the network settings of the specified device name. +.Description +Returns the network settings of the specified device name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicenetworksetting +#> +function Get-AzStorSimpleDeviceNetworkSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleDeviceNetworkSetting_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleDeviceNetworkSetting_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceTimeSetting.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceTimeSetting.ps1 new file mode 100644 index 000000000000..3985bb53549f --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceTimeSetting.ps1 @@ -0,0 +1,210 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the time settings of the specified device name. +.Description +Returns the time settings of the specified device name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicetimesetting +#> +function Get-AzStorSimpleDeviceTimeSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleDeviceTimeSetting_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleDeviceTimeSetting_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceUpdateSummary.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceUpdateSummary.ps1 new file mode 100644 index 000000000000..29b600786190 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleDeviceUpdateSummary.ps1 @@ -0,0 +1,210 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the update summary of the specified device name. +.Description +Returns the update summary of the specified device name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledeviceupdatesummary +#> +function Get-AzStorSimpleDeviceUpdateSummary { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleDeviceUpdateSummary_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleDeviceUpdateSummary_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileServer.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileServer.ps1 new file mode 100644 index 000000000000..3b81154aa3f5 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileServer.ps1 @@ -0,0 +1,226 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties of the specified file server name. +.Description +Returns the properties of the specified file server name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefileserver +#> +function Get-AzStorSimpleFileServer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('FileServerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleFileServer_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleFileServer_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleFileServer_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleFileServer_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileServerMetric.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileServerMetric.ps1 new file mode 100644 index 000000000000..35d0f3d65b55 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileServerMetric.ps1 @@ -0,0 +1,188 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the file server metrics. +.Description +Gets the file server metrics. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefileservermetric +#> +function Get-AzStorSimpleFileServerMetric { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the device. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the file server name. + ${FileServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleFileServerMetric_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileServerMetricDefinition.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileServerMetricDefinition.ps1 new file mode 100644 index 000000000000..f2221a61bdcd --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileServerMetricDefinition.ps1 @@ -0,0 +1,182 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieves metric definitions of all metrics aggregated at the file server. +.Description +Retrieves metric definitions of all metrics aggregated at the file server. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefileservermetricdefinition +#> +function Get-AzStorSimpleFileServerMetricDefinition { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the device. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the file server. + ${FileServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleFileServerMetricDefinition_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileShare.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileShare.ps1 new file mode 100644 index 000000000000..ca89f4d7727c --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileShare.ps1 @@ -0,0 +1,233 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties of the specified file share name. +.Description +Returns the properties of the specified file share name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefileshare +#> +function Get-AzStorSimpleFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${FileServerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file share name. + ${ShareName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleFileShare_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleFileShare_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleFileShare_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleFileShare_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileShareMetric.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileShareMetric.ps1 new file mode 100644 index 000000000000..1005effa06b8 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileShareMetric.ps1 @@ -0,0 +1,194 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the file share metrics +.Description +Gets the file share metrics +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefilesharemetric +#> +function Get-AzStorSimpleFileShareMetric { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${FileServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file share name. + ${ShareName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleFileShareMetric_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileShareMetricDefinition.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileShareMetricDefinition.ps1 new file mode 100644 index 000000000000..39de42ae93d3 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleFileShareMetricDefinition.ps1 @@ -0,0 +1,188 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieves metric definitions of all metrics aggregated at the file share. +.Description +Retrieves metric definitions of all metrics aggregated at the file share. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefilesharemetricdefinition +#> +function Get-AzStorSimpleFileShareMetricDefinition { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${FileServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file share name. + ${ShareName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleFileShareMetricDefinition_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiDisk.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiDisk.ps1 new file mode 100644 index 000000000000..242f8f993b11 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiDisk.ps1 @@ -0,0 +1,233 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties of the specified iSCSI disk name. +.Description +Returns the properties of the specified iSCSI disk name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsidisk +#> +function Get-AzStorSimpleIscsiDisk { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The disk name. + ${DiskName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleIscsiDisk_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleIscsiDisk_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleIscsiDisk_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleIscsiDisk_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiDiskMetric.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiDiskMetric.ps1 new file mode 100644 index 000000000000..7e8eb155ad97 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiDiskMetric.ps1 @@ -0,0 +1,194 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the iSCSI disk metrics +.Description +Gets the iSCSI disk metrics +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsidiskmetric +#> +function Get-AzStorSimpleIscsiDiskMetric { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI disk name. + ${DiskName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleIscsiDiskMetric_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiDiskMetricDefinition.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiDiskMetricDefinition.ps1 new file mode 100644 index 000000000000..cd36ec3d21a3 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiDiskMetricDefinition.ps1 @@ -0,0 +1,188 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieves metric definitions for all metric aggregated at the iSCSI disk. +.Description +Retrieves metric definitions for all metric aggregated at the iSCSI disk. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsidiskmetricdefinition +#> +function Get-AzStorSimpleIscsiDiskMetricDefinition { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI disk name. + ${DiskName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleIscsiDiskMetricDefinition_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiServer.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiServer.ps1 new file mode 100644 index 000000000000..0f70c14a1fbf --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiServer.ps1 @@ -0,0 +1,226 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties of the specified iSCSI server name. +.Description +Returns the properties of the specified iSCSI server name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsiserver +#> +function Get-AzStorSimpleIscsiServer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('IscsiServerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleIscsiServer_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleIscsiServer_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleIscsiServer_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleIscsiServer_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiServerMetric.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiServerMetric.ps1 new file mode 100644 index 000000000000..6598926d4938 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiServerMetric.ps1 @@ -0,0 +1,188 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the iSCSI server metrics +.Description +Gets the iSCSI server metrics +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsiservermetric +#> +function Get-AzStorSimpleIscsiServerMetric { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleIscsiServerMetric_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiServerMetricDefinition.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiServerMetricDefinition.ps1 new file mode 100644 index 000000000000..cc8e1b5526eb --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleIscsiServerMetricDefinition.ps1 @@ -0,0 +1,182 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieves metric definitions for all metrics aggregated at iSCSI server. +.Description +Retrieves metric definitions for all metrics aggregated at iSCSI server. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsiservermetricdefinition +#> +function Get-AzStorSimpleIscsiServerMetricDefinition { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleIscsiServerMetricDefinition_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleJob.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleJob.ps1 new file mode 100644 index 000000000000..7e8fdf8de81d --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleJob.ps1 @@ -0,0 +1,233 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties of the specified job name. +.Description +Returns the properties of the specified job name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplejob +#> +function Get-AzStorSimpleJob { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('JobName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The job name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleJob_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleJob_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleJob_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleJob_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManager.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManager.ps1 new file mode 100644 index 000000000000..fa855dfb901d --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManager.ps1 @@ -0,0 +1,210 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties of the specified manager name. +.Description +Returns the properties of the specified manager name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanager +#> +function Get-AzStorSimpleManager { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ManagerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleManager_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleManager_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleManager_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleManager_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerEncryptionKey.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerEncryptionKey.ps1 new file mode 100644 index 000000000000..2e84948bafd0 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerEncryptionKey.ps1 @@ -0,0 +1,204 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the symmetric encryption key of the manager. +.Description +Returns the symmetric encryption key of the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagerencryptionkey +#> +function Get-AzStorSimpleManagerEncryptionKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleManagerEncryptionKey_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleManagerEncryptionKey_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerEncryptionSetting.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerEncryptionSetting.ps1 new file mode 100644 index 000000000000..4c81f4ab62e1 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerEncryptionSetting.ps1 @@ -0,0 +1,204 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the encryption settings of the manager. +.Description +Returns the encryption settings of the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagerencryptionsetting +#> +function Get-AzStorSimpleManagerEncryptionSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleManagerEncryptionSetting_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleManagerEncryptionSetting_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerExtendedInfo.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerExtendedInfo.ps1 new file mode 100644 index 000000000000..9ae5f444e166 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerExtendedInfo.ps1 @@ -0,0 +1,204 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the extended information of the specified manager name. +.Description +Returns the extended information of the specified manager name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagerextendedinfo +#> +function Get-AzStorSimpleManagerExtendedInfo { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleManagerExtendedInfo_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleManagerExtendedInfo_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerMetric.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerMetric.ps1 new file mode 100644 index 000000000000..50205e09bab6 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerMetric.ps1 @@ -0,0 +1,176 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the manager metrics +.Description +Gets the manager metrics +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagermetric +#> +function Get-AzStorSimpleManagerMetric { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleManagerMetric_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerMetricDefinition.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerMetricDefinition.ps1 new file mode 100644 index 000000000000..4d70ea646c1f --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleManagerMetricDefinition.ps1 @@ -0,0 +1,170 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Retrieves metric definition of all metrics aggregated at manager. +.Description +Retrieves metric definition of all metrics aggregated at manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagermetricdefinition +#> +function Get-AzStorSimpleManagerMetricDefinition { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleManagerMetricDefinition_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleStorageAccountCredentials.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleStorageAccountCredentials.ps1 new file mode 100644 index 000000000000..8d5eb920658e --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleStorageAccountCredentials.ps1 @@ -0,0 +1,214 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties of the specified storage account credential name. +.Description +Returns the properties of the specified storage account credential name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplestorageaccountcredentials +#> +function Get-AzStorSimpleStorageAccountCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of storage account credential to be fetched. + ${CredentialName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleStorageAccountCredentials_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleStorageAccountCredentials_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleStorageAccountCredentials_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleStorageDomain.ps1 b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleStorageDomain.ps1 new file mode 100644 index 000000000000..de618c212de1 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Get-AzStorSimpleStorageDomain.ps1 @@ -0,0 +1,215 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties of the specified storage domain name. +.Description +Returns the properties of the specified storage domain name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplestoragedomain +#> +function Get-AzStorSimpleStorageDomain { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('StorageDomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The storage domain name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleStorageDomain_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleStorageDomain_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleStorageDomain_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Install-AzStorSimpleDeviceUpdate.ps1 b/swaggerci/storSimple1200Series/exports/Install-AzStorSimpleDeviceUpdate.ps1 new file mode 100644 index 000000000000..768ced744dd8 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Install-AzStorSimpleDeviceUpdate.ps1 @@ -0,0 +1,228 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Installs the updates on the device. +.Description +Installs the updates on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/install-azstorsimpledeviceupdate +#> +function Install-AzStorSimpleDeviceUpdate { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Install', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Install', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Install', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Install', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Install')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='InstallViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Install = 'Az.StorSimple.private\Install-AzStorSimpleDeviceUpdate_Install'; + InstallViaIdentity = 'Az.StorSimple.private\Install-AzStorSimpleDeviceUpdate_InstallViaIdentity'; + } + if (('Install') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Invoke-AzStorSimpleDeactivateDevice.ps1 b/swaggerci/storSimple1200Series/exports/Invoke-AzStorSimpleDeactivateDevice.ps1 new file mode 100644 index 000000000000..0b00e11a75e9 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Invoke-AzStorSimpleDeactivateDevice.ps1 @@ -0,0 +1,228 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deactivates the device. +.Description +Deactivates the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/invoke-azstorsimpledeactivatedevice +#> +function Invoke-AzStorSimpleDeactivateDevice { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Deactivate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Deactivate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Deactivate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Deactivate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Deactivate')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeactivateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Deactivate = 'Az.StorSimple.private\Invoke-AzStorSimpleDeactivateDevice_Deactivate'; + DeactivateViaIdentity = 'Az.StorSimple.private\Invoke-AzStorSimpleDeactivateDevice_DeactivateViaIdentity'; + } + if (('Deactivate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Invoke-AzStorSimpleDownloadDeviceUpdate.ps1 b/swaggerci/storSimple1200Series/exports/Invoke-AzStorSimpleDownloadDeviceUpdate.ps1 new file mode 100644 index 000000000000..90c37fc58f80 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Invoke-AzStorSimpleDownloadDeviceUpdate.ps1 @@ -0,0 +1,228 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Downloads updates on the device. +.Description +Downloads updates on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/invoke-azstorsimpledownloaddeviceupdate +#> +function Invoke-AzStorSimpleDownloadDeviceUpdate { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Download', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Download', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Download', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Download', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Download')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DownloadViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Download = 'Az.StorSimple.private\Invoke-AzStorSimpleDownloadDeviceUpdate_Download'; + DownloadViaIdentity = 'Az.StorSimple.private\Invoke-AzStorSimpleDownloadDeviceUpdate_DownloadViaIdentity'; + } + if (('Download') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Invoke-AzStorSimpleScanDevice.ps1 b/swaggerci/storSimple1200Series/exports/Invoke-AzStorSimpleScanDevice.ps1 new file mode 100644 index 000000000000..5faa2b1967d0 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Invoke-AzStorSimpleScanDevice.ps1 @@ -0,0 +1,228 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Scans for updates on the device. +.Description +Scans for updates on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/invoke-azstorsimplescandevice +#> +function Invoke-AzStorSimpleScanDevice { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Scan', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Scan', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Scan', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Scan', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Scan')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='ScanViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Scan = 'Az.StorSimple.private\Invoke-AzStorSimpleScanDevice_Scan'; + ScanViaIdentity = 'Az.StorSimple.private\Invoke-AzStorSimpleScanDevice_ScanViaIdentity'; + } + if (('Scan') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Invoke-AzStorSimpleUploadManagerRegistrationCertificate.ps1 b/swaggerci/storSimple1200Series/exports/Invoke-AzStorSimpleUploadManagerRegistrationCertificate.ps1 new file mode 100644 index 000000000000..330874842e84 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Invoke-AzStorSimpleUploadManagerRegistrationCertificate.ps1 @@ -0,0 +1,246 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse +.Description +Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id + +UPLOADCERTIFICATEREQUESTREQUEST : Upload Certificate Request to IDM + Certificate : Gets or sets the base64 encoded certificate raw data string + [AuthType ]: Specify the Authentication type +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/invoke-azstorsimpleuploadmanagerregistrationcertificate +#> +function Invoke-AzStorSimpleUploadManagerRegistrationCertificate { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse])] +[CmdletBinding(DefaultParameterSetName='UploadExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Upload', Mandatory)] + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # Certificate Name + ${CertificateName}, + + [Parameter(ParameterSetName='Upload', Mandatory)] + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Upload', Mandatory)] + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Upload')] + [Parameter(ParameterSetName='UploadExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='UploadViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UploadViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Upload', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UploadViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest] + # Upload Certificate Request to IDM + # To construct, see NOTES section for UPLOADCERTIFICATEREQUESTREQUEST properties and create a hash table. + ${UploadCertificateRequestrequest}, + + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Parameter(ParameterSetName='UploadViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Gets or sets the base64 encoded certificate raw data string + ${Certificate}, + + [Parameter(ParameterSetName='UploadExpanded')] + [Parameter(ParameterSetName='UploadViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType] + # Specify the Authentication type + ${AuthType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Upload = 'Az.StorSimple.private\Invoke-AzStorSimpleUploadManagerRegistrationCertificate_Upload'; + UploadExpanded = 'Az.StorSimple.private\Invoke-AzStorSimpleUploadManagerRegistrationCertificate_UploadExpanded'; + UploadViaIdentity = 'Az.StorSimple.private\Invoke-AzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentity'; + UploadViaIdentityExpanded = 'Az.StorSimple.private\Invoke-AzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentityExpanded'; + } + if (('Upload', 'UploadExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/New-AzStorSimpleAccessControlRecord.ps1 b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleAccessControlRecord.ps1 new file mode 100644 index 000000000000..d9a8dfc3d431 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleAccessControlRecord.ps1 @@ -0,0 +1,195 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or Updates an access control record. +.Description +Creates or Updates an access control record. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpleaccesscontrolrecord +#> +function New-AzStorSimpleAccessControlRecord { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Alias('AccessControlRecordName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the access control record. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The Iscsi initiator name (IQN) + ${InitiatorName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleAccessControlRecord_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/New-AzStorSimpleBackupScheduleGroup.ps1 b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleBackupScheduleGroup.ps1 new file mode 100644 index 000000000000..7c89eaaa0c34 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleBackupScheduleGroup.ps1 @@ -0,0 +1,206 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or Updates the backup schedule Group. +.Description +Creates or Updates the backup schedule Group. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplebackupschedulegroup +#> +function New-AzStorSimpleBackupScheduleGroup { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the device. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the schedule group. + ${ScheduleGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.Int32] + # The hour. + ${StartTimeHour}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.Int32] + # The minute. + ${StartTimeMinute}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleBackupScheduleGroup_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/New-AzStorSimpleChapSetting.ps1 b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleChapSetting.ps1 new file mode 100644 index 000000000000..22022949fabb --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleChapSetting.ps1 @@ -0,0 +1,214 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates the chap setting. +.Description +Creates or updates the chap setting. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplechapsetting +#> +function New-AzStorSimpleChapSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The chap user name. + ${ChapUserName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm] + # Algorithm used to encrypt "Value" + ${PasswordEncryptionAlgorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The value of the secret itself. + # If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + ${PasswordValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Thumbprint certificate that was used to encrypt "Value" + ${PasswordEncryptionCertificateThumbprint}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleChapSetting_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/New-AzStorSimpleDeviceAlertSetting.ps1 b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleDeviceAlertSetting.ps1 new file mode 100644 index 000000000000..97ebe0870961 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleDeviceAlertSetting.ps1 @@ -0,0 +1,217 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates the alert settings +.Description +Creates or updates the alert settings +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpledevicealertsetting +#> +function New-AzStorSimpleDeviceAlertSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Culture setting to be used while building alert emails. + # For eg: "en-US" + ${AlertNotificationCulture}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus] + # Value indicating whether user/admins will receive emails when an alert condition occurs on the system + ${EmailNotification}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus] + # Value indicating whether service owners will receive emails when an alert condition occurs on the system. + # Applicable only if emailNotification flag is Enabled. + ${NotificationToServiceOwner}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String[]] + # List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent + ${AdditionalRecipientEmailList}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleDeviceAlertSetting_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/New-AzStorSimpleDeviceSecuritySetting.ps1 b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleDeviceSecuritySetting.ps1 new file mode 100644 index 000000000000..9bccc613ef59 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleDeviceSecuritySetting.ps1 @@ -0,0 +1,214 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates the security settings. +.Description +Creates or updates the security settings. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpledevicesecuritysetting +#> +function New-AzStorSimpleDeviceSecuritySetting { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm] + # Algorithm used to encrypt "Value" + ${DeviceAdminPasswordEncryptionAlgorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The value of the secret itself. + # If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + ${DeviceAdminPasswordValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Thumbprint certificate that was used to encrypt "Value" + ${DeviceAdminPasswordEncryptionCertificateThumbprint}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleDeviceSecuritySetting_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/New-AzStorSimpleFileServer.ps1 b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleFileServer.ps1 new file mode 100644 index 000000000000..c86c3a4eb2d5 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleFileServer.ps1 @@ -0,0 +1,219 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates the file server. +.Description +Creates or updates the file server. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplefileserver +#> +function New-AzStorSimpleFileServer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Alias('FileServerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The backup policy id. + ${BackupScheduleGroupId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Domain of the file server + ${DomainName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The storage domain id. + ${StorageDomainId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The description of the file server + ${Description}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleFileServer_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/New-AzStorSimpleFileShare.ps1 b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleFileShare.ps1 new file mode 100644 index 000000000000..0d128227189f --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleFileShare.ps1 @@ -0,0 +1,241 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates the file share. +.Description +Creates or updates the file share. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplefileshare +#> +function New-AzStorSimpleFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${FileServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file share name. + ${ShareName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The user/group who will have full permission in this share. + # Active directory email address. + # Example: xyz@contoso.com or Contoso\xyz. + ${AdminUser}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy] + # The data policy + ${DataPolicy}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus] + # The monitoring status + ${MonitoringStatus}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.Int64] + # The total provisioned capacity in Bytes + ${ProvisionedCapacityInByte}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus] + # The Share Status + ${ShareStatus}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Description for file share + ${Description}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleFileShare_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/New-AzStorSimpleIscsiDisk.ps1 b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleIscsiDisk.ps1 new file mode 100644 index 000000000000..351f9cd304bf --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleIscsiDisk.ps1 @@ -0,0 +1,240 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates the iSCSI disk. +.Description +Creates or updates the iSCSI disk. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpleiscsidisk +#> +function New-AzStorSimpleIscsiDisk { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The disk name. + ${DiskName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String[]] + # The access control records. + ${AccessControlRecord}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy] + # The data policy. + ${DataPolicy}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus] + # The disk status. + ${DiskStatus}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus] + # The monitoring. + ${MonitoringStatus}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.Int64] + # The provisioned capacity in bytes. + ${ProvisionedCapacityInByte}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The description. + ${Description}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleIscsiDisk_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/New-AzStorSimpleIscsiServer.ps1 b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleIscsiServer.ps1 new file mode 100644 index 000000000000..d40d4f936e61 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleIscsiServer.ps1 @@ -0,0 +1,225 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates the iSCSI server. +.Description +Creates or updates the iSCSI server. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpleiscsiserver +#> +function New-AzStorSimpleIscsiServer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Alias('IscsiServerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The backup policy id. + ${BackupScheduleGroupId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The storage domain id. + ${StorageDomainId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The chap id. + ${ChapId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The description. + ${Description}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The reverse chap id. + ${ReverseChapId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleIscsiServer_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/New-AzStorSimpleManager.ps1 b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleManager.ps1 new file mode 100644 index 000000000000..3416f818e311 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleManager.ps1 @@ -0,0 +1,197 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates the manager. +.Description +Creates or updates the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplemanager +#> +function New-AzStorSimpleManager { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ManagerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The Geo location of the Manager + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType] + # Refers to the type of the StorSimple Manager + ${CiIntrinsicSettingType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # ETag of the Manager + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags]))] + [System.Collections.Hashtable] + # Tags attached to the Manager + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleManager_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/New-AzStorSimpleManagerExtendedInfo.ps1 b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleManagerExtendedInfo.ps1 new file mode 100644 index 000000000000..b20ede305bbf --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleManagerExtendedInfo.ps1 @@ -0,0 +1,214 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates the extended info of the manager. +.Description +Creates the extended info of the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplemanagerextendedinfo +#> +function New-AzStorSimpleManagerExtendedInfo { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the encryption algorithm used to encrypt the other keys. + # None - if EncryptionKey is saved in plain text format. + # AlgorithmName - if encryption is used + ${Algorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the CIK of the resource + ${IntegrityKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the CEK of the resource + ${EncryptionKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the Cert thumbprint that was used to encrypt the CEK + ${EncryptionKeyThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # ETag of the Resource + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + ${PortalCertificateThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the version of the ExtendedInfo object being persisted + ${Version}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleManagerExtendedInfo_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/New-AzStorSimpleStorageAccountCredentials.ps1 b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleStorageAccountCredentials.ps1 new file mode 100644 index 000000000000..e46996d7082b --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleStorageAccountCredentials.ps1 @@ -0,0 +1,240 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates the storage account credential +.Description +Creates or updates the storage account credential +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplestorageaccountcredentials +#> +function New-AzStorSimpleStorageAccountCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The credential name. + ${CredentialName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType] + # The cloud service provider + ${CloudType}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus] + # SSL needs to be enabled or not + ${EnableSsl}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The storage endpoint + ${EndPoint}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The storage account login + ${Login}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm] + # Algorithm used to encrypt "Value" + ${AccessKeyEncryptionAlgorithm}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Thumbprint certificate that was used to encrypt "Value" + ${AccessKeyEncryptionCertificateThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The value of the secret itself. + # If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + ${AccessKeyValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The storage account's geo location + ${Location}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleStorageAccountCredentials_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/New-AzStorSimpleStorageDomain.ps1 b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleStorageDomain.ps1 new file mode 100644 index 000000000000..ef07a8cc37db --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/New-AzStorSimpleStorageDomain.ps1 @@ -0,0 +1,223 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates the storage domain. +.Description +Creates or updates the storage domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplestoragedomain +#> +function New-AzStorSimpleStorageDomain { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Alias('StorageDomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The storage domain name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus] + # The encryption status "Enabled | Disabled". + ${EncryptionStatus}, + + [Parameter(Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String[]] + # The storage account credentials. + ${StorageAccountCredentialId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm] + # Algorithm used to encrypt "Value" + ${EncryptionKeyEncryptionAlgorithm}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Thumbprint certificate that was used to encrypt "Value" + ${EncryptionKeyEncryptionCertificateThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The value of the secret itself. + # If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + ${EncryptionKeyValue}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleStorageDomain_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/ProxyCmdletDefinitions.ps1 b/swaggerci/storSimple1200Series/exports/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..760108fafbc4 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,15810 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Backup the file server now. +.Description +Backup the file server now. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/backup-azstorsimplefileservernow +#> +function Backup-AzStorSimpleFileServerNow { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Backup', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${FileServerName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Backup')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='BackupViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Backup = 'Az.StorSimple.private\Backup-AzStorSimpleFileServerNow_Backup'; + BackupViaIdentity = 'Az.StorSimple.private\Backup-AzStorSimpleFileServerNow_BackupViaIdentity'; + } + if (('Backup') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Backup the iSCSI server now. +.Description +Backup the iSCSI server now. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/backup-azstorsimpleiscsiservernow +#> +function Backup-AzStorSimpleIscsiServerNow { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Backup', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Backup', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Backup')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='BackupViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Backup = 'Az.StorSimple.private\Backup-AzStorSimpleIscsiServerNow_Backup'; + BackupViaIdentity = 'Az.StorSimple.private\Backup-AzStorSimpleIscsiServerNow_BackupViaIdentity'; + } + if (('Backup') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Clear the alerts. +.Description +Clear the alerts. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id + +REQUEST : Request for clearing the alert + Alert : List of alert Ids to be cleared + [ResolutionMessage ]: Resolution message while clearing the request +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/clear-azstorsimplealert +#> +function Clear-AzStorSimpleAlert { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='ClearExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Clear', Mandatory)] + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Clear', Mandatory)] + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Clear')] + [Parameter(ParameterSetName='ClearExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='ClearViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ClearViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Clear', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ClearViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest] + # Request for clearing the alert + # To construct, see NOTES section for REQUEST properties and create a hash table. + ${Request}, + + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Parameter(ParameterSetName='ClearViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String[]] + # List of alert Ids to be cleared + ${Alert}, + + [Parameter(ParameterSetName='ClearExpanded')] + [Parameter(ParameterSetName='ClearViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Resolution message while clearing the request + ${ResolutionMessage}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Clear = 'Az.StorSimple.private\Clear-AzStorSimpleAlert_Clear'; + ClearExpanded = 'Az.StorSimple.private\Clear-AzStorSimpleAlert_ClearExpanded'; + ClearViaIdentity = 'Az.StorSimple.private\Clear-AzStorSimpleAlert_ClearViaIdentity'; + ClearViaIdentityExpanded = 'Az.StorSimple.private\Clear-AzStorSimpleAlert_ClearViaIdentityExpanded'; + } + if (('Clear', 'ClearExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Clones the given backup element to a new disk or share with given details. +.Description +Clones the given backup element to a new disk or share with given details. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CLONEREQUEST : Clone Job Request Model. + NewEndpointName : Name of new endpoint which will created as part of clone job. + TargetAccessPointId : Access point Id on which clone job will performed. + TargetDeviceId : DeviceId of the device which will act as the Clone target + [AccessControlRecord ]: The access control records. + [AdminUser ]: The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\xyz. + [DiskPropertiesDataPolicy ]: The data policy. + [DiskPropertiesDescription ]: The description. + [DiskPropertiesMonitoringStatus ]: The monitoring. + [DiskPropertiesProvisionedCapacityInByte ]: The provisioned capacity in bytes. + [DiskStatus ]: The disk status. + [SharePropertiesDataPolicy ]: The data policy + [SharePropertiesDescription ]: Description for file share + [SharePropertiesMonitoringStatus ]: The monitoring status + [SharePropertiesProvisionedCapacityInByte ]: The total provisioned capacity in Bytes + [ShareStatus ]: The Share Status + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/copy-azstorsimplebackup +#> +function Copy-AzStorSimpleBackup { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CloneExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Clone', Mandatory)] + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Clone', Mandatory)] + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The backup element name. + ${ElementName}, + + [Parameter(ParameterSetName='Clone', Mandatory)] + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Clone', Mandatory)] + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Alias('BackupName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The backup name. + ${Name}, + + [Parameter(ParameterSetName='Clone', Mandatory)] + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Clone')] + [Parameter(ParameterSetName='CloneExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='CloneViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CloneViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Clone', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CloneViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest] + # Clone Job Request Model. + # To construct, see NOTES section for CLONEREQUEST properties and create a hash table. + ${CloneRequest}, + + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Parameter(ParameterSetName='CloneViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Name of new endpoint which will created as part of clone job. + ${NewEndpointName}, + + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Parameter(ParameterSetName='CloneViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Access point Id on which clone job will performed. + ${TargetAccessPointId}, + + [Parameter(ParameterSetName='CloneExpanded', Mandatory)] + [Parameter(ParameterSetName='CloneViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # DeviceId of the device which will act as the Clone target + ${TargetDeviceId}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String[]] + # The access control records. + ${AccessControlRecord}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The user/group who will have full permission in this share. + # Active directory email address. + # Example: xyz@contoso.com or Contoso\xyz. + ${AdminUser}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy] + # The data policy. + ${DiskPropertiesDataPolicy}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The description. + ${DiskPropertiesDescription}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus] + # The monitoring. + ${DiskPropertiesMonitoringStatus}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.Int64] + # The provisioned capacity in bytes. + ${DiskPropertiesProvisionedCapacityInByte}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus] + # The disk status. + ${DiskStatus}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy] + # The data policy + ${SharePropertiesDataPolicy}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Description for file share + ${SharePropertiesDescription}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus] + # The monitoring status + ${SharePropertiesMonitoringStatus}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.Int64] + # The total provisioned capacity in Bytes + ${SharePropertiesProvisionedCapacityInByte}, + + [Parameter(ParameterSetName='CloneExpanded')] + [Parameter(ParameterSetName='CloneViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus] + # The Share Status + ${ShareStatus}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Clone = 'Az.StorSimple.private\Copy-AzStorSimpleBackup_Clone'; + CloneExpanded = 'Az.StorSimple.private\Copy-AzStorSimpleBackup_CloneExpanded'; + CloneViaIdentity = 'Az.StorSimple.private\Copy-AzStorSimpleBackup_CloneViaIdentity'; + CloneViaIdentityExpanded = 'Az.StorSimple.private\Copy-AzStorSimpleBackup_CloneViaIdentityExpanded'; + } + if (('Clone', 'CloneExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties of the specified access control record name. +.Description +Returns the properties of the specified access control record name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleaccesscontrolrecord +#> +function Get-AzStorSimpleAccessControlRecord { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('AccessControlRecordName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # Name of access control record to be fetched. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleAccessControlRecord_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleAccessControlRecord_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleAccessControlRecord_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieves all the alerts in a manager. +.Description +Retrieves all the alerts in a manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplealert +#> +function Get-AzStorSimpleAlert { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleAlert_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List of AvailableProviderOperations +.Description +List of AvailableProviderOperations +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleavailableprovideroperation +#> +function Get-AzStorSimpleAvailableProviderOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleAvailableProviderOperation_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties of the specified backup schedule group name. +.Description +Returns the properties of the specified backup schedule group name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplebackupschedulegroup +#> +function Get-AzStorSimpleBackupScheduleGroup { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the device. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the schedule group. + ${ScheduleGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleBackupScheduleGroup_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleBackupScheduleGroup_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleBackupScheduleGroup_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieves all the backups in a manager. +.Description +Retrieves all the backups in a manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplebackup +#> +function Get-AzStorSimpleBackup { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.Management.Automation.SwitchParameter] + # Set to true if you need backups which can be used for failover. + ${ForFailover}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleBackup_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleBackup_List1'; + } + if (('List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties of the specified chap setting name. +.Description +Returns the properties of the specified chap setting name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplechapsetting +#> +function Get-AzStorSimpleChapSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The user name of chap to be fetched. + ${ChapUserName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleChapSetting_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleChapSetting_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleChapSetting_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the alert settings of the specified device name. +.Description +Returns the alert settings of the specified device name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicealertsetting +#> +function Get-AzStorSimpleDeviceAlertSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleDeviceAlertSetting_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleDeviceAlertSetting_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieves all the devices which can be used as failover targets for the given device. +.Description +Retrieves all the devices which can be used as failover targets for the given device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicefailovertarget +#> +function Get-AzStorSimpleDeviceFailoverTarget { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # Specify $expand=details to populate additional fields related to the device. + ${Expand}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleDeviceFailoverTarget_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieves metric definition of all metrics aggregated at device. +.Description +Retrieves metric definition of all metrics aggregated at device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicemetricdefinition +#> +function Get-AzStorSimpleDeviceMetricDefinition { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the appliance. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleDeviceMetricDefinition_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieves the device metrics. +.Description +Retrieves the device metrics. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicemetric +#> +function Get-AzStorSimpleDeviceMetric { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the appliance. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleDeviceMetric_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the network settings of the specified device name. +.Description +Returns the network settings of the specified device name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicenetworksetting +#> +function Get-AzStorSimpleDeviceNetworkSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleDeviceNetworkSetting_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleDeviceNetworkSetting_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the time settings of the specified device name. +.Description +Returns the time settings of the specified device name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevicetimesetting +#> +function Get-AzStorSimpleDeviceTimeSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleDeviceTimeSetting_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleDeviceTimeSetting_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the update summary of the specified device name. +.Description +Returns the update summary of the specified device name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledeviceupdatesummary +#> +function Get-AzStorSimpleDeviceUpdateSummary { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleDeviceUpdateSummary_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleDeviceUpdateSummary_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties of the specified device name. +.Description +Returns the properties of the specified device name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpledevice +#> +function Get-AzStorSimpleDevice { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # Specify $expand=details to populate additional fields related to the device. + ${Expand}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleDevice_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleDevice_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleDevice_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieves metric definitions of all metrics aggregated at the file server. +.Description +Retrieves metric definitions of all metrics aggregated at the file server. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefileservermetricdefinition +#> +function Get-AzStorSimpleFileServerMetricDefinition { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the device. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the file server. + ${FileServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleFileServerMetricDefinition_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the file server metrics. +.Description +Gets the file server metrics. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefileservermetric +#> +function Get-AzStorSimpleFileServerMetric { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the device. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the file server name. + ${FileServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleFileServerMetric_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties of the specified file server name. +.Description +Returns the properties of the specified file server name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefileserver +#> +function Get-AzStorSimpleFileServer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('FileServerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleFileServer_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleFileServer_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleFileServer_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleFileServer_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieves metric definitions of all metrics aggregated at the file share. +.Description +Retrieves metric definitions of all metrics aggregated at the file share. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefilesharemetricdefinition +#> +function Get-AzStorSimpleFileShareMetricDefinition { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${FileServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file share name. + ${ShareName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleFileShareMetricDefinition_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the file share metrics +.Description +Gets the file share metrics +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefilesharemetric +#> +function Get-AzStorSimpleFileShareMetric { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${FileServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file share name. + ${ShareName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleFileShareMetric_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties of the specified file share name. +.Description +Returns the properties of the specified file share name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplefileshare +#> +function Get-AzStorSimpleFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${FileServerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file share name. + ${ShareName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleFileShare_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleFileShare_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleFileShare_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleFileShare_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieves metric definitions for all metric aggregated at the iSCSI disk. +.Description +Retrieves metric definitions for all metric aggregated at the iSCSI disk. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsidiskmetricdefinition +#> +function Get-AzStorSimpleIscsiDiskMetricDefinition { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI disk name. + ${DiskName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleIscsiDiskMetricDefinition_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the iSCSI disk metrics +.Description +Gets the iSCSI disk metrics +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsidiskmetric +#> +function Get-AzStorSimpleIscsiDiskMetric { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI disk name. + ${DiskName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleIscsiDiskMetric_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties of the specified iSCSI disk name. +.Description +Returns the properties of the specified iSCSI disk name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsidisk +#> +function Get-AzStorSimpleIscsiDisk { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The disk name. + ${DiskName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleIscsiDisk_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleIscsiDisk_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleIscsiDisk_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleIscsiDisk_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieves metric definitions for all metrics aggregated at iSCSI server. +.Description +Retrieves metric definitions for all metrics aggregated at iSCSI server. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsiservermetricdefinition +#> +function Get-AzStorSimpleIscsiServerMetricDefinition { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleIscsiServerMetricDefinition_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the iSCSI server metrics +.Description +Gets the iSCSI server metrics +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsiservermetric +#> +function Get-AzStorSimpleIscsiServerMetric { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleIscsiServerMetric_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties of the specified iSCSI server name. +.Description +Returns the properties of the specified iSCSI server name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimpleiscsiserver +#> +function Get-AzStorSimpleIscsiServer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('IscsiServerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleIscsiServer_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleIscsiServer_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleIscsiServer_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleIscsiServer_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties of the specified job name. +.Description +Returns the properties of the specified job name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplejob +#> +function Get-AzStorSimpleJob { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob])] +[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('JobName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The job name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleJob_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleJob_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleJob_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleJob_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the symmetric encryption key of the manager. +.Description +Returns the symmetric encryption key of the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagerencryptionkey +#> +function Get-AzStorSimpleManagerEncryptionKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleManagerEncryptionKey_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleManagerEncryptionKey_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the encryption settings of the manager. +.Description +Returns the encryption settings of the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagerencryptionsetting +#> +function Get-AzStorSimpleManagerEncryptionSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleManagerEncryptionSetting_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleManagerEncryptionSetting_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the extended information of the specified manager name. +.Description +Returns the extended information of the specified manager name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagerextendedinfo +#> +function Get-AzStorSimpleManagerExtendedInfo { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleManagerExtendedInfo_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleManagerExtendedInfo_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Retrieves metric definition of all metrics aggregated at manager. +.Description +Retrieves metric definition of all metrics aggregated at manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagermetricdefinition +#> +function Get-AzStorSimpleManagerMetricDefinition { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleManagerMetricDefinition_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the manager metrics +.Description +Gets the manager metrics +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanagermetric +#> +function Get-AzStorSimpleManagerMetric { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Query')] + [System.String] + # OData Filter options + ${Filter}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.StorSimple.private\Get-AzStorSimpleManagerMetric_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties of the specified manager name. +.Description +Returns the properties of the specified manager name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplemanager +#> +function Get-AzStorSimpleManager { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ManagerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleManager_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleManager_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleManager_List'; + List1 = 'Az.StorSimple.private\Get-AzStorSimpleManager_List1'; + } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties of the specified storage account credential name. +.Description +Returns the properties of the specified storage account credential name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplestorageaccountcredentials +#> +function Get-AzStorSimpleStorageAccountCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of storage account credential to be fetched. + ${CredentialName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleStorageAccountCredentials_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleStorageAccountCredentials_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleStorageAccountCredentials_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties of the specified storage domain name. +.Description +Returns the properties of the specified storage domain name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/get-azstorsimplestoragedomain +#> +function Get-AzStorSimpleStorageDomain { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('StorageDomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The storage domain name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.StorSimple.private\Get-AzStorSimpleStorageDomain_Get'; + GetViaIdentity = 'Az.StorSimple.private\Get-AzStorSimpleStorageDomain_GetViaIdentity'; + List = 'Az.StorSimple.private\Get-AzStorSimpleStorageDomain_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Installs the updates on the device. +.Description +Installs the updates on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/install-azstorsimpledeviceupdate +#> +function Install-AzStorSimpleDeviceUpdate { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Install', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Install', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Install', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Install', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Install')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='InstallViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Install = 'Az.StorSimple.private\Install-AzStorSimpleDeviceUpdate_Install'; + InstallViaIdentity = 'Az.StorSimple.private\Install-AzStorSimpleDeviceUpdate_InstallViaIdentity'; + } + if (('Install') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deactivates the device. +.Description +Deactivates the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/invoke-azstorsimpledeactivatedevice +#> +function Invoke-AzStorSimpleDeactivateDevice { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Deactivate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Deactivate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Deactivate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Deactivate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Deactivate')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeactivateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Deactivate = 'Az.StorSimple.private\Invoke-AzStorSimpleDeactivateDevice_Deactivate'; + DeactivateViaIdentity = 'Az.StorSimple.private\Invoke-AzStorSimpleDeactivateDevice_DeactivateViaIdentity'; + } + if (('Deactivate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Downloads updates on the device. +.Description +Downloads updates on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/invoke-azstorsimpledownloaddeviceupdate +#> +function Invoke-AzStorSimpleDownloadDeviceUpdate { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Download', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Download', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Download', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Download', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Download')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DownloadViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Download = 'Az.StorSimple.private\Invoke-AzStorSimpleDownloadDeviceUpdate_Download'; + DownloadViaIdentity = 'Az.StorSimple.private\Invoke-AzStorSimpleDownloadDeviceUpdate_DownloadViaIdentity'; + } + if (('Download') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Scans for updates on the device. +.Description +Scans for updates on the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/invoke-azstorsimplescandevice +#> +function Invoke-AzStorSimpleScanDevice { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Scan', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Scan', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Scan', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Scan', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Scan')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='ScanViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Scan = 'Az.StorSimple.private\Invoke-AzStorSimpleScanDevice_Scan'; + ScanViaIdentity = 'Az.StorSimple.private\Invoke-AzStorSimpleScanDevice_ScanViaIdentity'; + } + if (('Scan') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse +.Description +Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id + +UPLOADCERTIFICATEREQUESTREQUEST : Upload Certificate Request to IDM + Certificate : Gets or sets the base64 encoded certificate raw data string + [AuthType ]: Specify the Authentication type +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/invoke-azstorsimpleuploadmanagerregistrationcertificate +#> +function Invoke-AzStorSimpleUploadManagerRegistrationCertificate { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse])] +[CmdletBinding(DefaultParameterSetName='UploadExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Upload', Mandatory)] + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # Certificate Name + ${CertificateName}, + + [Parameter(ParameterSetName='Upload', Mandatory)] + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Upload', Mandatory)] + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Upload')] + [Parameter(ParameterSetName='UploadExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='UploadViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UploadViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Upload', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UploadViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest] + # Upload Certificate Request to IDM + # To construct, see NOTES section for UPLOADCERTIFICATEREQUESTREQUEST properties and create a hash table. + ${UploadCertificateRequestrequest}, + + [Parameter(ParameterSetName='UploadExpanded', Mandatory)] + [Parameter(ParameterSetName='UploadViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Gets or sets the base64 encoded certificate raw data string + ${Certificate}, + + [Parameter(ParameterSetName='UploadExpanded')] + [Parameter(ParameterSetName='UploadViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType] + # Specify the Authentication type + ${AuthType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Upload = 'Az.StorSimple.private\Invoke-AzStorSimpleUploadManagerRegistrationCertificate_Upload'; + UploadExpanded = 'Az.StorSimple.private\Invoke-AzStorSimpleUploadManagerRegistrationCertificate_UploadExpanded'; + UploadViaIdentity = 'Az.StorSimple.private\Invoke-AzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentity'; + UploadViaIdentityExpanded = 'Az.StorSimple.private\Invoke-AzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentityExpanded'; + } + if (('Upload', 'UploadExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or Updates an access control record. +.Description +Creates or Updates an access control record. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpleaccesscontrolrecord +#> +function New-AzStorSimpleAccessControlRecord { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Alias('AccessControlRecordName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the access control record. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The Iscsi initiator name (IQN) + ${InitiatorName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleAccessControlRecord_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or Updates the backup schedule Group. +.Description +Creates or Updates the backup schedule Group. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplebackupschedulegroup +#> +function New-AzStorSimpleBackupScheduleGroup { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the device. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the schedule group. + ${ScheduleGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.Int32] + # The hour. + ${StartTimeHour}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.Int32] + # The minute. + ${StartTimeMinute}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleBackupScheduleGroup_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates the chap setting. +.Description +Creates or updates the chap setting. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplechapsetting +#> +function New-AzStorSimpleChapSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The chap user name. + ${ChapUserName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm] + # Algorithm used to encrypt "Value" + ${PasswordEncryptionAlgorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The value of the secret itself. + # If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + ${PasswordValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Thumbprint certificate that was used to encrypt "Value" + ${PasswordEncryptionCertificateThumbprint}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleChapSetting_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates the alert settings +.Description +Creates or updates the alert settings +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpledevicealertsetting +#> +function New-AzStorSimpleDeviceAlertSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Culture setting to be used while building alert emails. + # For eg: "en-US" + ${AlertNotificationCulture}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus] + # Value indicating whether user/admins will receive emails when an alert condition occurs on the system + ${EmailNotification}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus] + # Value indicating whether service owners will receive emails when an alert condition occurs on the system. + # Applicable only if emailNotification flag is Enabled. + ${NotificationToServiceOwner}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String[]] + # List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent + ${AdditionalRecipientEmailList}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleDeviceAlertSetting_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates the security settings. +.Description +Creates or updates the security settings. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +System.Boolean +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpledevicesecuritysetting +#> +function New-AzStorSimpleDeviceSecuritySetting { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm] + # Algorithm used to encrypt "Value" + ${DeviceAdminPasswordEncryptionAlgorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The value of the secret itself. + # If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + ${DeviceAdminPasswordValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Thumbprint certificate that was used to encrypt "Value" + ${DeviceAdminPasswordEncryptionCertificateThumbprint}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleDeviceSecuritySetting_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates the file server. +.Description +Creates or updates the file server. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplefileserver +#> +function New-AzStorSimpleFileServer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Alias('FileServerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The backup policy id. + ${BackupScheduleGroupId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Domain of the file server + ${DomainName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The storage domain id. + ${StorageDomainId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The description of the file server + ${Description}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleFileServer_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates the file share. +.Description +Creates or updates the file share. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplefileshare +#> +function New-AzStorSimpleFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${FileServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file share name. + ${ShareName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The user/group who will have full permission in this share. + # Active directory email address. + # Example: xyz@contoso.com or Contoso\xyz. + ${AdminUser}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy] + # The data policy + ${DataPolicy}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus] + # The monitoring status + ${MonitoringStatus}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.Int64] + # The total provisioned capacity in Bytes + ${ProvisionedCapacityInByte}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus] + # The Share Status + ${ShareStatus}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Description for file share + ${Description}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleFileShare_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates the iSCSI disk. +.Description +Creates or updates the iSCSI disk. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpleiscsidisk +#> +function New-AzStorSimpleIscsiDisk { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The disk name. + ${DiskName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String[]] + # The access control records. + ${AccessControlRecord}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy] + # The data policy. + ${DataPolicy}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus] + # The disk status. + ${DiskStatus}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus] + # The monitoring. + ${MonitoringStatus}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.Int64] + # The provisioned capacity in bytes. + ${ProvisionedCapacityInByte}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The description. + ${Description}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleIscsiDisk_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates the iSCSI server. +.Description +Creates or updates the iSCSI server. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimpleiscsiserver +#> +function New-AzStorSimpleIscsiServer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Alias('IscsiServerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The backup policy id. + ${BackupScheduleGroupId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The storage domain id. + ${StorageDomainId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The chap id. + ${ChapId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The description. + ${Description}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The reverse chap id. + ${ReverseChapId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleIscsiServer_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates the extended info of the manager. +.Description +Creates the extended info of the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplemanagerextendedinfo +#> +function New-AzStorSimpleManagerExtendedInfo { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the encryption algorithm used to encrypt the other keys. + # None - if EncryptionKey is saved in plain text format. + # AlgorithmName - if encryption is used + ${Algorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the CIK of the resource + ${IntegrityKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the CEK of the resource + ${EncryptionKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the Cert thumbprint that was used to encrypt the CEK + ${EncryptionKeyThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # ETag of the Resource + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + ${PortalCertificateThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the version of the ExtendedInfo object being persisted + ${Version}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleManagerExtendedInfo_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates the manager. +.Description +Creates or updates the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplemanager +#> +function New-AzStorSimpleManager { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ManagerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The Geo location of the Manager + ${Location}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType] + # Refers to the type of the StorSimple Manager + ${CiIntrinsicSettingType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # ETag of the Manager + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags]))] + [System.Collections.Hashtable] + # Tags attached to the Manager + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleManager_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates the storage account credential +.Description +Creates or updates the storage account credential +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplestorageaccountcredentials +#> +function New-AzStorSimpleStorageAccountCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The credential name. + ${CredentialName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType] + # The cloud service provider + ${CloudType}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus] + # SSL needs to be enabled or not + ${EnableSsl}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The storage endpoint + ${EndPoint}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The storage account login + ${Login}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm] + # Algorithm used to encrypt "Value" + ${AccessKeyEncryptionAlgorithm}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Thumbprint certificate that was used to encrypt "Value" + ${AccessKeyEncryptionCertificateThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The value of the secret itself. + # If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + ${AccessKeyValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The storage account's geo location + ${Location}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleStorageAccountCredentials_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates the storage domain. +.Description +Creates or updates the storage domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/new-azstorsimplestoragedomain +#> +function New-AzStorSimpleStorageDomain { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(Mandatory)] + [Alias('StorageDomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The storage domain name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus] + # The encryption status "Enabled | Disabled". + ${EncryptionStatus}, + + [Parameter(Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String[]] + # The storage account credentials. + ${StorageAccountCredentialId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm] + # Algorithm used to encrypt "Value" + ${EncryptionKeyEncryptionAlgorithm}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Thumbprint certificate that was used to encrypt "Value" + ${EncryptionKeyEncryptionCertificateThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The value of the secret itself. + # If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + ${EncryptionKeyValue}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.StorSimple.private\New-AzStorSimpleStorageDomain_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the access control record. +.Description +Deletes the access control record. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimpleaccesscontrolrecord +#> +function Remove-AzStorSimpleAccessControlRecord { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('AccessControlRecordName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the access control record to delete. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleAccessControlRecord_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleAccessControlRecord_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the backup schedule group. +.Description +Deletes the backup schedule group. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplebackupschedulegroup +#> +function Remove-AzStorSimpleBackupScheduleGroup { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the device. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the schedule group. + ${ScheduleGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleBackupScheduleGroup_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleBackupScheduleGroup_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the backup. +.Description +Deletes the backup. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplebackup +#> +function Remove-AzStorSimpleBackup { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('BackupName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The backup name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleBackup_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleBackup_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the chap setting. +.Description +Deletes the chap setting. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplechapsetting +#> +function Remove-AzStorSimpleChapSetting { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The chap user name. + ${ChapUserName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleChapSetting_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleChapSetting_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the device. +.Description +Deletes the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimpledevice +#> +function Remove-AzStorSimpleDevice { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleDevice_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleDevice_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the file server. +.Description +Deletes the file server. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplefileserver +#> +function Remove-AzStorSimpleFileServer { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('FileServerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleFileServer_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleFileServer_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the file share. +.Description +Deletes the file share. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplefileshare +#> +function Remove-AzStorSimpleFileShare { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${FileServerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file share Name + ${ShareName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleFileShare_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleFileShare_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the iSCSI disk. +.Description +Deletes the iSCSI disk. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimpleiscsidisk +#> +function Remove-AzStorSimpleIscsiDisk { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The disk name. + ${DiskName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleIscsiDisk_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleIscsiDisk_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the iSCSI server. +.Description +Deletes the iSCSI server. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimpleiscsiserver +#> +function Remove-AzStorSimpleIscsiServer { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('IscsiServerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleIscsiServer_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleIscsiServer_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the extended info of the manager. +.Description +Deletes the extended info of the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplemanagerextendedinfo +#> +function Remove-AzStorSimpleManagerExtendedInfo { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleManagerExtendedInfo_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleManagerExtendedInfo_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the manager. +.Description +Deletes the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplemanager +#> +function Remove-AzStorSimpleManager { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ManagerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleManager_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleManager_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the storage account credential +.Description +Deletes the storage account credential +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplestorageaccountcredentials +#> +function Remove-AzStorSimpleStorageAccountCredentials { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the storage account credential. + ${CredentialName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleStorageAccountCredentials_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleStorageAccountCredentials_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the storage domain. +.Description +Deletes the storage domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplestoragedomain +#> +function Remove-AzStorSimpleStorageDomain { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('StorageDomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The storage domain name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleStorageDomain_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleStorageDomain_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Sends a test alert email. +.Description +Sends a test alert email. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id + +REQUEST : Request for sending test alert email + EmailList : List of emails to send the test alerts +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/send-azstorsimplealerttestemail +#> +function Send-AzStorSimpleAlertTestEmail { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='SendExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Send', Mandatory)] + [Parameter(ParameterSetName='SendExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Send', Mandatory)] + [Parameter(ParameterSetName='SendExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Send', Mandatory)] + [Parameter(ParameterSetName='SendExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Send')] + [Parameter(ParameterSetName='SendExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='SendViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='SendViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Send', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='SendViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest] + # Request for sending test alert email + # To construct, see NOTES section for REQUEST properties and create a hash table. + ${Request}, + + [Parameter(ParameterSetName='SendExpanded', Mandatory)] + [Parameter(ParameterSetName='SendViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String[]] + # List of emails to send the test alerts + ${EmailList}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Send = 'Az.StorSimple.private\Send-AzStorSimpleAlertTestEmail_Send'; + SendExpanded = 'Az.StorSimple.private\Send-AzStorSimpleAlertTestEmail_SendExpanded'; + SendViaIdentity = 'Az.StorSimple.private\Send-AzStorSimpleAlertTestEmail_SendViaIdentity'; + SendViaIdentityExpanded = 'Az.StorSimple.private\Send-AzStorSimpleAlertTestEmail_SendViaIdentityExpanded'; + } + if (('Send', 'SendExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates the security settings. +.Description +Creates or updates the security settings. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/update-azstorsimpledevicesecuritysetting +#> +function Update-AzStorSimpleDeviceSecuritySetting { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm] + # Algorithm used to encrypt "Value" + ${DeviceAdminPasswordEncryptionAlgorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The value of the secret itself. + # If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + ${DeviceAdminPasswordValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Thumbprint certificate that was used to encrypt "Value" + ${DeviceAdminPasswordEncryptionCertificateThumbprint}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.StorSimple.private\Update-AzStorSimpleDeviceSecuritySetting_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.StorSimple.private\Update-AzStorSimpleDeviceSecuritySetting_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Patches the device. +.Description +Patches the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +DEVICEPATCH : Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" + [DeviceDescription ]: Short description given for the device + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/update-azstorsimpledevice +#> +function Update-AzStorSimpleDevice { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice])] +[CmdletBinding(DefaultParameterSetName='PatchExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device Name. + ${Name}, + + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Patch')] + [Parameter(ParameterSetName='PatchExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='PatchViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PatchViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Patch', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PatchViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch] + # Class that represents the Input for the PATCH call on Device. + # Currently the only patchable property on device is "DeviceDescription" + # To construct, see NOTES section for DEVICEPATCH properties and create a hash table. + ${DevicePatch}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Short description given for the device + ${DeviceDescription}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Patch = 'Az.StorSimple.private\Update-AzStorSimpleDevice_Patch'; + PatchExpanded = 'Az.StorSimple.private\Update-AzStorSimpleDevice_PatchExpanded'; + PatchViaIdentity = 'Az.StorSimple.private\Update-AzStorSimpleDevice_PatchViaIdentity'; + PatchViaIdentityExpanded = 'Az.StorSimple.private\Update-AzStorSimpleDevice_PatchViaIdentityExpanded'; + } + if (('Patch', 'PatchExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Updates the extended info of the manager. +.Description +Updates the extended info of the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/update-azstorsimplemanagerextendedinfo +#> +function Update-AzStorSimpleManagerExtendedInfo { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Header')] + [System.String] + # Pass the ETag of ExtendedInfo fetched from GET call + ${IfMatch}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the encryption algorithm used to encrypt the other keys. + # None - if EncryptionKey is saved in plain text format. + # AlgorithmName - if encryption is used + ${Algorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the CIK of the resource + ${IntegrityKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the CEK of the resource + ${EncryptionKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the Cert thumbprint that was used to encrypt the CEK + ${EncryptionKeyThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # ETag of the Resource + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + ${PortalCertificateThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the version of the ExtendedInfo object being persisted + ${Version}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.StorSimple.private\Update-AzStorSimpleManagerExtendedInfo_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.StorSimple.private\Update-AzStorSimpleManagerExtendedInfo_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Updates the StorSimple Manager. +.Description +Updates the StorSimple Manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/update-azstorsimplemanager +#> +function Update-AzStorSimpleManager { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ManagerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags]))] + [System.Collections.Hashtable] + # The tags attached to the StorSimple Manager. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.StorSimple.private\Update-AzStorSimpleManager_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.StorSimple.private\Update-AzStorSimpleManager_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/README.md b/swaggerci/storSimple1200Series/exports/README.md new file mode 100644 index 000000000000..ea9b6b846cfb --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/README.md @@ -0,0 +1,20 @@ +# Exports +This directory contains the cmdlets *exported by* `Az.StorSimple`. No other cmdlets in this repository are directly exported. What that means is the `Az.StorSimple` module will run [Export-ModuleMember](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`../bin/Az.StorSimple.private.dll`) and from the `../custom/Az.StorSimple.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [README.md](../internal/README.md) in the `../internal` folder. + +## Purpose +We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles. + +## Structure +The cmdlets generated here will flat in the directory (no sub-folders) as long as there are no Azure profiles specified for any cmdlets. Azure profiles (the `Profiles` attribute) is only applied when generating with the `--azure` attribute (or `azure: true` in the configuration). When Azure profiles are applied, the folder structure has a folder per profile. Each profile folder has only those cmdlets that apply to that profile. + +## Usage +When `./Az.StorSimple.psm1` is loaded, it dynamically exports cmdlets here based on the folder structure and on the selected profile. If there are no sub-folders, it exports all cmdlets at the root of this folder. If there are sub-folders, it checks to see the selected profile. If no profile is selected, it exports the cmdlets in the last sub-folder (alphabetically). If a profile is selected, it exports the cmdlets in the sub-folder that matches the profile name. If there is no sub-folder that matches the profile name, it exports no cmdlets and writes a warning message. \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleAccessControlRecord.ps1 b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleAccessControlRecord.ps1 new file mode 100644 index 000000000000..cc9612e8ed7a --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleAccessControlRecord.ps1 @@ -0,0 +1,229 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the access control record. +.Description +Deletes the access control record. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimpleaccesscontrolrecord +#> +function Remove-AzStorSimpleAccessControlRecord { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('AccessControlRecordName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the access control record to delete. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleAccessControlRecord_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleAccessControlRecord_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleBackup.ps1 b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleBackup.ps1 new file mode 100644 index 000000000000..a8d19fb03a9b --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleBackup.ps1 @@ -0,0 +1,235 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the backup. +.Description +Deletes the backup. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplebackup +#> +function Remove-AzStorSimpleBackup { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('BackupName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The backup name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleBackup_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleBackup_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleBackupScheduleGroup.ps1 b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleBackupScheduleGroup.ps1 new file mode 100644 index 000000000000..570959b5a2f8 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleBackupScheduleGroup.ps1 @@ -0,0 +1,234 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the backup schedule group. +.Description +Deletes the backup schedule group. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplebackupschedulegroup +#> +function Remove-AzStorSimpleBackupScheduleGroup { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the device. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the schedule group. + ${ScheduleGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleBackupScheduleGroup_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleBackupScheduleGroup_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleChapSetting.ps1 b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleChapSetting.ps1 new file mode 100644 index 000000000000..0575b86fa5b7 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleChapSetting.ps1 @@ -0,0 +1,234 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the chap setting. +.Description +Deletes the chap setting. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplechapsetting +#> +function Remove-AzStorSimpleChapSetting { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The chap user name. + ${ChapUserName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleChapSetting_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleChapSetting_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleDevice.ps1 b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleDevice.ps1 new file mode 100644 index 000000000000..d7953ba145c6 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleDevice.ps1 @@ -0,0 +1,229 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the device. +.Description +Deletes the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimpledevice +#> +function Remove-AzStorSimpleDevice { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleDevice_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleDevice_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleFileServer.ps1 b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleFileServer.ps1 new file mode 100644 index 000000000000..3fb0585b171c --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleFileServer.ps1 @@ -0,0 +1,235 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the file server. +.Description +Deletes the file server. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplefileserver +#> +function Remove-AzStorSimpleFileServer { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('FileServerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleFileServer_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleFileServer_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleFileShare.ps1 b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleFileShare.ps1 new file mode 100644 index 000000000000..2918e989c5c0 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleFileShare.ps1 @@ -0,0 +1,240 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the file share. +.Description +Deletes the file share. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplefileshare +#> +function Remove-AzStorSimpleFileShare { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file server name. + ${FileServerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The file share Name + ${ShareName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleFileShare_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleFileShare_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleIscsiDisk.ps1 b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleIscsiDisk.ps1 new file mode 100644 index 000000000000..fe3ed7abc7b0 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleIscsiDisk.ps1 @@ -0,0 +1,240 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the iSCSI disk. +.Description +Deletes the iSCSI disk. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimpleiscsidisk +#> +function Remove-AzStorSimpleIscsiDisk { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The disk name. + ${DiskName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${IscsiServerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleIscsiDisk_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleIscsiDisk_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleIscsiServer.ps1 b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleIscsiServer.ps1 new file mode 100644 index 000000000000..f2d0598905a9 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleIscsiServer.ps1 @@ -0,0 +1,235 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the iSCSI server. +.Description +Deletes the iSCSI server. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimpleiscsiserver +#> +function Remove-AzStorSimpleIscsiServer { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('IscsiServerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The iSCSI server name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleIscsiServer_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleIscsiServer_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleManager.ps1 b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleManager.ps1 new file mode 100644 index 000000000000..df280fcb6291 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleManager.ps1 @@ -0,0 +1,211 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the manager. +.Description +Deletes the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplemanager +#> +function Remove-AzStorSimpleManager { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ManagerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleManager_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleManager_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleManagerExtendedInfo.ps1 b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleManagerExtendedInfo.ps1 new file mode 100644 index 000000000000..7a24fb4d34af --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleManagerExtendedInfo.ps1 @@ -0,0 +1,210 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the extended info of the manager. +.Description +Deletes the extended info of the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplemanagerextendedinfo +#> +function Remove-AzStorSimpleManagerExtendedInfo { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleManagerExtendedInfo_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleManagerExtendedInfo_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleStorageAccountCredentials.ps1 b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleStorageAccountCredentials.ps1 new file mode 100644 index 000000000000..45ede52e4c9e --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleStorageAccountCredentials.ps1 @@ -0,0 +1,228 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the storage account credential +.Description +Deletes the storage account credential +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplestorageaccountcredentials +#> +function Remove-AzStorSimpleStorageAccountCredentials { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The name of the storage account credential. + ${CredentialName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleStorageAccountCredentials_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleStorageAccountCredentials_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleStorageDomain.ps1 b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleStorageDomain.ps1 new file mode 100644 index 000000000000..6b814c109499 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Remove-AzStorSimpleStorageDomain.ps1 @@ -0,0 +1,229 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the storage domain. +.Description +Deletes the storage domain. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/remove-azstorsimplestoragedomain +#> +function Remove-AzStorSimpleStorageDomain { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('StorageDomainName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The storage domain name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.StorSimple.private\Remove-AzStorSimpleStorageDomain_Delete'; + DeleteViaIdentity = 'Az.StorSimple.private\Remove-AzStorSimpleStorageDomain_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Send-AzStorSimpleAlertTestEmail.ps1 b/swaggerci/storSimple1200Series/exports/Send-AzStorSimpleAlertTestEmail.ps1 new file mode 100644 index 000000000000..ecbdbb48b493 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Send-AzStorSimpleAlertTestEmail.ps1 @@ -0,0 +1,244 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Sends a test alert email. +.Description +Sends a test alert email. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id + +REQUEST : Request for sending test alert email + EmailList : List of emails to send the test alerts +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/send-azstorsimplealerttestemail +#> +function Send-AzStorSimpleAlertTestEmail { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='SendExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Send', Mandatory)] + [Parameter(ParameterSetName='SendExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='Send', Mandatory)] + [Parameter(ParameterSetName='SendExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Send', Mandatory)] + [Parameter(ParameterSetName='SendExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Send')] + [Parameter(ParameterSetName='SendExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='SendViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='SendViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Send', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='SendViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest] + # Request for sending test alert email + # To construct, see NOTES section for REQUEST properties and create a hash table. + ${Request}, + + [Parameter(ParameterSetName='SendExpanded', Mandatory)] + [Parameter(ParameterSetName='SendViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String[]] + # List of emails to send the test alerts + ${EmailList}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Send = 'Az.StorSimple.private\Send-AzStorSimpleAlertTestEmail_Send'; + SendExpanded = 'Az.StorSimple.private\Send-AzStorSimpleAlertTestEmail_SendExpanded'; + SendViaIdentity = 'Az.StorSimple.private\Send-AzStorSimpleAlertTestEmail_SendViaIdentity'; + SendViaIdentityExpanded = 'Az.StorSimple.private\Send-AzStorSimpleAlertTestEmail_SendViaIdentityExpanded'; + } + if (('Send', 'SendExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Update-AzStorSimpleDevice.ps1 b/swaggerci/storSimple1200Series/exports/Update-AzStorSimpleDevice.ps1 new file mode 100644 index 000000000000..87518ae856aa --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Update-AzStorSimpleDevice.ps1 @@ -0,0 +1,251 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Patches the device. +.Description +Patches the device. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +DEVICEPATCH : Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" + [DeviceDescription ]: Short description given for the device + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/update-azstorsimpledevice +#> +function Update-AzStorSimpleDevice { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice])] +[CmdletBinding(DefaultParameterSetName='PatchExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Alias('DeviceName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device Name. + ${Name}, + + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Patch')] + [Parameter(ParameterSetName='PatchExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='PatchViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PatchViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Patch', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PatchViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch] + # Class that represents the Input for the PATCH call on Device. + # Currently the only patchable property on device is "DeviceDescription" + # To construct, see NOTES section for DEVICEPATCH properties and create a hash table. + ${DevicePatch}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Short description given for the device + ${DeviceDescription}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Patch = 'Az.StorSimple.private\Update-AzStorSimpleDevice_Patch'; + PatchExpanded = 'Az.StorSimple.private\Update-AzStorSimpleDevice_PatchExpanded'; + PatchViaIdentity = 'Az.StorSimple.private\Update-AzStorSimpleDevice_PatchViaIdentity'; + PatchViaIdentityExpanded = 'Az.StorSimple.private\Update-AzStorSimpleDevice_PatchViaIdentityExpanded'; + } + if (('Patch', 'PatchExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Update-AzStorSimpleDeviceSecuritySetting.ps1 b/swaggerci/storSimple1200Series/exports/Update-AzStorSimpleDeviceSecuritySetting.ps1 new file mode 100644 index 000000000000..78a829f9fd64 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Update-AzStorSimpleDeviceSecuritySetting.ps1 @@ -0,0 +1,248 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates the security settings. +.Description +Creates or updates the security settings. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/update-azstorsimpledevicesecuritysetting +#> +function Update-AzStorSimpleDeviceSecuritySetting { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The device name. + ${DeviceName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm])] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm] + # Algorithm used to encrypt "Value" + ${DeviceAdminPasswordEncryptionAlgorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # The value of the secret itself. + # If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null. + ${DeviceAdminPasswordValue}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Thumbprint certificate that was used to encrypt "Value" + ${DeviceAdminPasswordEncryptionCertificateThumbprint}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.StorSimple.private\Update-AzStorSimpleDeviceSecuritySetting_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.StorSimple.private\Update-AzStorSimpleDeviceSecuritySetting_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Update-AzStorSimpleManager.ps1 b/swaggerci/storSimple1200Series/exports/Update-AzStorSimpleManager.ps1 new file mode 100644 index 000000000000..3f81ab2361ae --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Update-AzStorSimpleManager.ps1 @@ -0,0 +1,212 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Updates the StorSimple Manager. +.Description +Updates the StorSimple Manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/update-azstorsimplemanager +#> +function Update-AzStorSimpleManager { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ManagerName')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags]))] + [System.Collections.Hashtable] + # The tags attached to the StorSimple Manager. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.StorSimple.private\Update-AzStorSimpleManager_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.StorSimple.private\Update-AzStorSimpleManager_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/exports/Update-AzStorSimpleManagerExtendedInfo.ps1 b/swaggerci/storSimple1200Series/exports/Update-AzStorSimpleManagerExtendedInfo.ps1 new file mode 100644 index 000000000000..a901e08ff0a2 --- /dev/null +++ b/swaggerci/storSimple1200Series/exports/Update-AzStorSimpleManagerExtendedInfo.ps1 @@ -0,0 +1,254 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Updates the extended info of the manager. +.Description +Updates the extended info of the manager. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccessControlRecordName ]: Name of access control record to be fetched. + [BackupName ]: The backup name. + [CertificateName ]: Certificate Name + [ChapUserName ]: The user name of chap to be fetched. + [CredentialName ]: The name of storage account credential to be fetched. + [DeviceName ]: The device name. + [DiskName ]: The disk name. + [ElementName ]: The backup element name. + [FileServerName ]: The file server name. + [Id ]: Resource identity path + [IscsiServerName ]: The iSCSI server name. + [JobName ]: The job name. + [ManagerName ]: The manager name + [ResourceGroupName ]: The resource group name + [ScheduleGroupName ]: The name of the schedule group. + [ShareName ]: The file share name. + [StorageDomainName ]: The storage domain name. + [SubscriptionId ]: The subscription id +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storsimple/update-azstorsimplemanagerextendedinfo +#> +function Update-AzStorSimpleManagerExtendedInfo { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The manager name + ${ManagerName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [System.String] + # The resource group name + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The subscription id + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Header')] + [System.String] + # Pass the ETag of ExtendedInfo fetched from GET call + ${IfMatch}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the encryption algorithm used to encrypt the other keys. + # None - if EncryptionKey is saved in plain text format. + # AlgorithmName - if encryption is used + ${Algorithm}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the CIK of the resource + ${IntegrityKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the CEK of the resource + ${EncryptionKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the Cert thumbprint that was used to encrypt the CEK + ${EncryptionKeyThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # ETag of the Resource + ${Etag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + ${PortalCertificateThumbprint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Body')] + [System.String] + # Represents the version of the ExtendedInfo object being persisted + ${Version}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.StorSimple.private\Update-AzStorSimpleManagerExtendedInfo_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.StorSimple.private\Update-AzStorSimpleManagerExtendedInfo_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storSimple1200Series/generate-help.ps1 b/swaggerci/storSimple1200Series/generate-help.ps1 new file mode 100644 index 000000000000..a4315683f811 --- /dev/null +++ b/swaggerci/storSimple1200Series/generate-help.ps1 @@ -0,0 +1,66 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(-not (Test-Path $exportsFolder)) { + Write-Error "Exports folder '$exportsFolder' was not found." +} + +$directories = Get-ChildItem -Directory -Path $exportsFolder +$hasProfiles = ($directories | Measure-Object).Count -gt 0 +if(-not $hasProfiles) { + $directories = Get-Item -Path $exportsFolder +} + +$docsFolder = Join-Path $PSScriptRoot 'docs' +if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue +$examplesFolder = Join-Path $PSScriptRoot 'examples' + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.StorSimple.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +# Load DLL to use build-time cmdlets +Import-Module -Name $modulePath +Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.StorSimple.private.dll') +$instance = [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module]::Instance +# Module info is shared per profile +$moduleInfo = Get-Module -Name $moduleName + +foreach($directory in $directories) +{ + if($hasProfiles) { + Select-AzProfile -Name $directory.Name + } + # Reload module per profile + Import-Module -Name $modulePath -Force + + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $directory.FullName + $cmdletHelpInfo = $cmdletNames | ForEach-Object { Get-Help -Name $_ -Full } + $cmdletFunctionInfo = Get-ScriptCmdlet -ScriptFolder $directory.FullName -AsFunctionInfo + + $docsPath = Join-Path $docsFolder $directory.Name + $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue + $examplesPath = Join-Path $examplesFolder $directory.Name + + Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath + Write-Host -ForegroundColor Green "Created documentation in '$docsPath'" +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/Module.cs b/swaggerci/storSimple1200Series/generated/Module.cs new file mode 100644 index 000000000000..ead8f65f8398 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/Module.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using SendAsyncStepDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + using PipelineChangeDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>; + using GetParameterDelegate = global::System.Func; + using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using ArgumentCompleterDelegate = global::System.Func; + using GetTelemetryIdDelegate = global::System.Func; + using TelemetryDelegate = global::System.Action; + using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>; + using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>; + using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + + /// A class that contains the module-common code and data. + public partial class Module + { + /// The currently selected profile. + public string Profile = global::System.String.Empty; + + public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + + /// the ISendAsync pipeline instance + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline _pipeline; + + /// the ISendAsync pipeline instance (when proxy is enabled) + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline _pipelineWithProxy; + + public bool _useProxy = false; + + public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); + + /// Gets completion data for azure specific fields + public ArgumentCompleterDelegate ArgumentCompleter { get; set; } + + /// The instance of the Client API + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient ClientAPI { get; set; } + + /// A delegate that gets called for each signalled event + public EventListenerDelegate EventListener { get; set; } + + /// The delegate to call to get parameter data from a common module. + public GetParameterDelegate GetParameterValue { get; set; } + + /// The delegate to get the telemetry Id. + public GetTelemetryIdDelegate GetTelemetryId { get; set; } + + /// Backing field for property. + private static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module _instance; + + /// the singleton of this module class + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module()); + + /// The Name of this module + public string Name => @"Az.StorSimple"; + + /// The delegate to call when this module is loaded (supporting a commmon module). + public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } + + /// The delegate to call before each new request (supporting a commmon module). + public NewRequestPipelineDelegate OnNewRequest { get; set; } + + /// The name of the currently selected Azure profile + public global::System.String ProfileName { get; set; } + + /// The ResourceID for this module (azure arm). + public string ResourceId => @"Az.StorSimple"; + + /// The delegate for creating a telemetry. + public TelemetryDelegate Telemetry { get; set; } + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void AfterCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline pipeline); + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void BeforeCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline pipeline); + + partial void CustomInit(); + + /// Creates an instance of the HttpPipeline for each call. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the cmdlet's parameterset name. + /// a dict for extensible parameters + /// An instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline for the remote call. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline CreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string processRecordId, string parameterSetName = null, global::System.Collections.Generic.IDictionary extensibleParameters = null) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline pipeline = null; + BeforeCreatePipeline(invocationInfo, ref pipeline); + pipeline = (pipeline ?? (_useProxy ? _pipelineWithProxy : _pipeline)).Clone(); + AfterCreatePipeline(invocationInfo, ref pipeline); + pipeline.Append(new Runtime.CmdInfoHandler(processRecordId, invocationInfo, parameterSetName).SendAsync); + OnNewRequest?.Invoke( invocationInfo, correlationId,processRecordId, (step)=> { pipeline.Prepend(step); } , (step)=> { pipeline.Append(step); } ); + return pipeline; + } + + /// Gets parameters from a common module. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// The name of the parameter to get the value for. + /// + /// The parameter value from the common module. (Note: this should be type converted on the way back) + /// + public object GetParameter(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string parameterName) => GetParameterValue?.Invoke( ResourceId, Name, invocationInfo, correlationId,parameterName ); + + /// Initialization steps performed after the module is loaded. + public void Init() + { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + } + + /// Creates the module instance. + private Module() + { + // constructor + ClientAPI = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient(); + _handler.Proxy = _webProxy; + _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient())); + _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient(_handler))); + } + + /// The HTTP Proxy to use. + /// The HTTP Proxy Credentials + /// True if the proxy should use default credentials + public void SetProxyConfiguration(global::System.Uri proxy, global::System.Management.Automation.PSCredential proxyCredential, bool proxyUseDefaultCredentials) + { + _useProxy = proxy != null; + if (proxy == null) + { + return; + } + // set the proxy configuration + _webProxy.Address = proxy; + _webProxy.BypassProxyOnLocal = false; + if (proxyUseDefaultCredentials) + { + _webProxy.Credentials = null; + _webProxy.UseDefaultCredentials = true; + } + else + { + _webProxy.UseDefaultCredentials = false; + _webProxy.Credentials = proxyCredential ?.GetNetworkCredential(); + } + } + + /// Called to dispatch events to the common module listener + /// The ID of the event + /// The cancellation token for the event + /// A delegate to get the detailed event data + /// The callback for the event dispatcher + /// The from the cmdlet + /// the cmdlet's parameterset name. + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the exception that is being thrown (if available) + /// + /// A that will be complete when handling of the event is completed. + /// + public async global::System.Threading.Tasks.Task Signal(string id, global::System.Threading.CancellationToken token, global::System.Func getEventData, SignalDelegate signal, global::System.Management.Automation.InvocationInfo invocationInfo, string parameterSetName, string correlationId, string processRecordId, global::System.Exception exception) + { + using( NoSynchronizationContext ) + { + await EventListener?.Invoke(id,token,getEventData, signal, invocationInfo, parameterSetName, correlationId,processRecordId,exception); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Any.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Any.PowerShell.cs new file mode 100644 index 000000000000..06c1c4af29ad --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Any.PowerShell.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial class Any + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Any(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Any(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Any(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Any(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial interface IAny + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Any.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Any.TypeConverter.cs new file mode 100644 index 000000000000..5376d61f4137 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Any.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AnyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Any.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Any.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Any.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Any.cs b/swaggerci/storSimple1200Series/generated/api/Models/Any.cs new file mode 100644 index 000000000000..0b0029e913f8 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Any.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Any object + public partial class Any : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAnyInternal + { + + /// Creates an new instance. + public Any() + { + + } + } + /// Any object + public partial interface IAny : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + + } + /// Any object + internal partial interface IAnyInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Any.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Any.json.cs new file mode 100644 index 000000000000..4b3098920091 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Any.json.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Any object + public partial class Any + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal Any(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny. + /// + /// a to deserialize from. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new Any(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecord.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecord.PowerShell.cs new file mode 100644 index 000000000000..2d3a99722e4a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecord.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The access control record + [System.ComponentModel.TypeConverter(typeof(AccessControlRecordTypeConverter))] + public partial class AccessControlRecord + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AccessControlRecord(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecordPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("InitiatorName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordInternal)this).InitiatorName = (string) content.GetValueForProperty("InitiatorName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordInternal)this).InitiatorName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AccessControlRecord(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecordPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("InitiatorName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordInternal)this).InitiatorName = (string) content.GetValueForProperty("InitiatorName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordInternal)this).InitiatorName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AccessControlRecord(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AccessControlRecord(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The access control record + [System.ComponentModel.TypeConverter(typeof(AccessControlRecordTypeConverter))] + public partial interface IAccessControlRecord + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecord.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecord.TypeConverter.cs new file mode 100644 index 000000000000..5aeae534e524 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecord.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AccessControlRecordTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AccessControlRecord.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AccessControlRecord.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AccessControlRecord.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecord.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecord.cs new file mode 100644 index 000000000000..9c1ff55af269 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecord.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The access control record + public partial class AccessControlRecord : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// The Iscsi initiator name (IQN) + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string InitiatorName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordPropertiesInternal)Property).InitiatorName; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordPropertiesInternal)Property).InitiatorName = value ; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecordProperties()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties _property; + + /// Properties of AccessControlRecord + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecordProperties()); set => this._property = value; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public AccessControlRecord() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The access control record + public partial interface IAccessControlRecord : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// The Iscsi initiator name (IQN) + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Iscsi initiator name (IQN)", + SerializedName = @"initiatorName", + PossibleTypes = new [] { typeof(string) })] + string InitiatorName { get; set; } + + } + /// The access control record + internal partial interface IAccessControlRecordInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The Iscsi initiator name (IQN) + string InitiatorName { get; set; } + /// Properties of AccessControlRecord + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecord.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecord.json.cs new file mode 100644 index 000000000000..0436359646c3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecord.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The access control record + public partial class AccessControlRecord + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AccessControlRecord(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecordProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AccessControlRecord(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordList.PowerShell.cs new file mode 100644 index 000000000000..e96a062e722b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordList.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Collection of AccessControlRecords + [System.ComponentModel.TypeConverter(typeof(AccessControlRecordListTypeConverter))] + public partial class AccessControlRecordList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AccessControlRecordList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecordTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AccessControlRecordList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecordTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AccessControlRecordList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AccessControlRecordList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of AccessControlRecords + [System.ComponentModel.TypeConverter(typeof(AccessControlRecordListTypeConverter))] + public partial interface IAccessControlRecordList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordList.TypeConverter.cs new file mode 100644 index 000000000000..58162b0faff3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AccessControlRecordListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AccessControlRecordList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AccessControlRecordList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AccessControlRecordList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordList.cs new file mode 100644 index 000000000000..b4a78895c1af --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of AccessControlRecords + public partial class AccessControlRecordList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public AccessControlRecordList() + { + + } + } + /// Collection of AccessControlRecords + public partial interface IAccessControlRecordList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord[] Value { get; set; } + + } + /// Collection of AccessControlRecords + internal partial interface IAccessControlRecordListInternal + + { + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordList.json.cs new file mode 100644 index 000000000000..3cf5ead20042 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of AccessControlRecords + public partial class AccessControlRecordList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AccessControlRecordList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecord.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AccessControlRecordList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordProperties.PowerShell.cs new file mode 100644 index 000000000000..472f34512197 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordProperties.PowerShell.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Properties of access control record + [System.ComponentModel.TypeConverter(typeof(AccessControlRecordPropertiesTypeConverter))] + public partial class AccessControlRecordProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AccessControlRecordProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InitiatorName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordPropertiesInternal)this).InitiatorName = (string) content.GetValueForProperty("InitiatorName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordPropertiesInternal)this).InitiatorName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AccessControlRecordProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InitiatorName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordPropertiesInternal)this).InitiatorName = (string) content.GetValueForProperty("InitiatorName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordPropertiesInternal)this).InitiatorName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AccessControlRecordProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AccessControlRecordProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of access control record + [System.ComponentModel.TypeConverter(typeof(AccessControlRecordPropertiesTypeConverter))] + public partial interface IAccessControlRecordProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordProperties.TypeConverter.cs new file mode 100644 index 000000000000..bc1c618d3318 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AccessControlRecordPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AccessControlRecordProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AccessControlRecordProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AccessControlRecordProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordProperties.cs new file mode 100644 index 000000000000..256f5992d2e1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordProperties.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Properties of access control record + public partial class AccessControlRecordProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordPropertiesInternal + { + + /// Backing field for property. + private string _initiatorName; + + /// The Iscsi initiator name (IQN) + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string InitiatorName { get => this._initiatorName; set => this._initiatorName = value; } + + /// Creates an new instance. + public AccessControlRecordProperties() + { + + } + } + /// Properties of access control record + public partial interface IAccessControlRecordProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The Iscsi initiator name (IQN) + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Iscsi initiator name (IQN)", + SerializedName = @"initiatorName", + PossibleTypes = new [] { typeof(string) })] + string InitiatorName { get; set; } + + } + /// Properties of access control record + internal partial interface IAccessControlRecordPropertiesInternal + + { + /// The Iscsi initiator name (IQN) + string InitiatorName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordProperties.json.cs new file mode 100644 index 000000000000..b24ef08fc5c5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AccessControlRecordProperties.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Properties of access control record + public partial class AccessControlRecordProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AccessControlRecordProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_initiatorName = If( json?.PropertyT("initiatorName"), out var __jsonInitiatorName) ? (string)__jsonInitiatorName : (string)InitiatorName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AccessControlRecordProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._initiatorName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._initiatorName.ToString()) : null, "initiatorName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Alert.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Alert.PowerShell.cs new file mode 100644 index 000000000000..aa67102ce469 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Alert.PowerShell.cs @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Alert class + [System.ComponentModel.TypeConverter(typeof(AlertTypeConverter))] + public partial class Alert + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Alert(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSourceTypeConverter.ConvertFrom); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope.CreateFrom); + } + if (content.Contains("AlertType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).AlertType = (string) content.GetValueForProperty("AlertType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).AlertType, global::System.Convert.ToString); + } + if (content.Contains("AppearedAtTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).AppearedAtTime = (global::System.DateTime) content.GetValueForProperty("AppearedAtTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).AppearedAtTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AppearedAtSourceTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).AppearedAtSourceTime = (global::System.DateTime) content.GetValueForProperty("AppearedAtSourceTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).AppearedAtSourceTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClearedAtTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ClearedAtTime = (global::System.DateTime?) content.GetValueForProperty("ClearedAtTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ClearedAtTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClearedAtSourceTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ClearedAtSourceTime = (global::System.DateTime?) content.GetValueForProperty("ClearedAtSourceTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ClearedAtSourceTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Recommendation = (string) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Recommendation, global::System.Convert.ToString); + } + if (content.Contains("ResolutionReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ResolutionReason = (string) content.GetValueForProperty("ResolutionReason",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ResolutionReason, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity.CreateFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus.CreateFrom); + } + if (content.Contains("DetailedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).DetailedInformation = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation) content.GetValueForProperty("DetailedInformation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).DetailedInformation, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertPropertiesDetailedInformationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).SourceName = (string) content.GetValueForProperty("SourceName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).SourceName, global::System.Convert.ToString); + } + if (content.Contains("SourceTimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).SourceTimeZone = (string) content.GetValueForProperty("SourceTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).SourceTimeZone, global::System.Convert.ToString); + } + if (content.Contains("SourceAlertSourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).SourceAlertSourceType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType?) content.GetValueForProperty("SourceAlertSourceType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).SourceAlertSourceType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType.CreateFrom); + } + if (content.Contains("ErrorDetailErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetailErrorCode = (string) content.GetValueForProperty("ErrorDetailErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetailErrorCode, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetailErrorMessage = (string) content.GetValueForProperty("ErrorDetailErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetailErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailOccurence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetailOccurence = (int?) content.GetValueForProperty("ErrorDetailOccurence",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetailOccurence, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Alert(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSourceTypeConverter.ConvertFrom); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope.CreateFrom); + } + if (content.Contains("AlertType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).AlertType = (string) content.GetValueForProperty("AlertType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).AlertType, global::System.Convert.ToString); + } + if (content.Contains("AppearedAtTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).AppearedAtTime = (global::System.DateTime) content.GetValueForProperty("AppearedAtTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).AppearedAtTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AppearedAtSourceTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).AppearedAtSourceTime = (global::System.DateTime) content.GetValueForProperty("AppearedAtSourceTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).AppearedAtSourceTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClearedAtTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ClearedAtTime = (global::System.DateTime?) content.GetValueForProperty("ClearedAtTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ClearedAtTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClearedAtSourceTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ClearedAtSourceTime = (global::System.DateTime?) content.GetValueForProperty("ClearedAtSourceTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ClearedAtSourceTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Recommendation = (string) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Recommendation, global::System.Convert.ToString); + } + if (content.Contains("ResolutionReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ResolutionReason = (string) content.GetValueForProperty("ResolutionReason",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ResolutionReason, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity.CreateFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus.CreateFrom); + } + if (content.Contains("DetailedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).DetailedInformation = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation) content.GetValueForProperty("DetailedInformation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).DetailedInformation, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertPropertiesDetailedInformationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).SourceName = (string) content.GetValueForProperty("SourceName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).SourceName, global::System.Convert.ToString); + } + if (content.Contains("SourceTimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).SourceTimeZone = (string) content.GetValueForProperty("SourceTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).SourceTimeZone, global::System.Convert.ToString); + } + if (content.Contains("SourceAlertSourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).SourceAlertSourceType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType?) content.GetValueForProperty("SourceAlertSourceType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).SourceAlertSourceType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType.CreateFrom); + } + if (content.Contains("ErrorDetailErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetailErrorCode = (string) content.GetValueForProperty("ErrorDetailErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetailErrorCode, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetailErrorMessage = (string) content.GetValueForProperty("ErrorDetailErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetailErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailOccurence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetailOccurence = (int?) content.GetValueForProperty("ErrorDetailOccurence",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal)this).ErrorDetailOccurence, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Alert(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Alert(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Alert class + [System.ComponentModel.TypeConverter(typeof(AlertTypeConverter))] + public partial interface IAlert + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Alert.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Alert.TypeConverter.cs new file mode 100644 index 000000000000..cff26735e5e3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Alert.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Alert.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Alert.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Alert.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Alert.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Alert.cs new file mode 100644 index 000000000000..0adc2c43b90a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Alert.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Alert class + public partial class Alert : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// Type of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string AlertType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).AlertType; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).AlertType = value ; } + + /// UTC time at which the alert appeared on the source + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime AppearedAtSourceTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).AppearedAtSourceTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).AppearedAtSourceTime = value ; } + + /// UTC time at which the alert appeared + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime AppearedAtTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).AppearedAtTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).AppearedAtTime = value ; } + + /// UTC time at which the alert was cleared on the source + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime? ClearedAtSourceTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ClearedAtSourceTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ClearedAtSourceTime = value ?? default(global::System.DateTime); } + + /// UTC time at which the alert got cleared + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime? ClearedAtTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ClearedAtTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ClearedAtTime = value ?? default(global::System.DateTime); } + + /// Other information about the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation DetailedInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).DetailedInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).DetailedInformation = value ?? null /* model class */; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ErrorDetailErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ErrorDetailErrorCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ErrorDetailErrorCode = value ?? null; } + + /// Error Message + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ErrorDetailErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ErrorDetailErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ErrorDetailErrorMessage = value ?? null; } + + /// Number of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? ErrorDetailOccurence { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ErrorDetailOccurence; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ErrorDetailOccurence = value ?? default(int); } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Internal Acessors for ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal.ErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ErrorDetail = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertProperties()); set { {_property = value;} } } + + /// Internal Acessors for Source + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertInternal.Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).Source = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties _property; + + /// Properties of alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertProperties()); set => this._property = value; } + + /// Recommendation for acting on the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Recommendation { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).Recommendation; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).Recommendation = value ?? null; } + + /// Reason for resolving the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ResolutionReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ResolutionReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).ResolutionReason = value ?? null; } + + /// Device or Resource alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).Scope = value ; } + + /// Severity of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity Severity { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).Severity; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).Severity = value ; } + + /// Source type of the alert. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? SourceAlertSourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).SourceAlertSourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).SourceAlertSourceType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType)""); } + + /// Name of the source. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string SourceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).SourceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).SourceName = value ?? null; } + + /// The time zone. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string SourceTimeZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).SourceTimeZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).SourceTimeZone = value ?? null; } + + /// Current status of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).Status = value ; } + + /// Title of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Title { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).Title; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)Property).Title = value ; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public Alert() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// Alert class + public partial interface IAlert : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// Type of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the alert", + SerializedName = @"alertType", + PossibleTypes = new [] { typeof(string) })] + string AlertType { get; set; } + /// UTC time at which the alert appeared on the source + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"UTC time at which the alert appeared on the source", + SerializedName = @"appearedAtSourceTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime AppearedAtSourceTime { get; set; } + /// UTC time at which the alert appeared + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"UTC time at which the alert appeared", + SerializedName = @"appearedAtTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime AppearedAtTime { get; set; } + /// UTC time at which the alert was cleared on the source + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"UTC time at which the alert was cleared on the source", + SerializedName = @"clearedAtSourceTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ClearedAtSourceTime { get; set; } + /// UTC time at which the alert got cleared + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"UTC time at which the alert got cleared", + SerializedName = @"clearedAtTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ClearedAtTime { get; set; } + /// Other information about the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Other information about the alert", + SerializedName = @"detailedInformation", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation DetailedInformation { get; set; } + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code.", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailErrorCode { get; set; } + /// Error Message + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error Message", + SerializedName = @"errorMessage", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailErrorMessage { get; set; } + /// Number of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of occurrences.", + SerializedName = @"occurences", + PossibleTypes = new [] { typeof(int) })] + int? ErrorDetailOccurence { get; set; } + /// Recommendation for acting on the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recommendation for acting on the alert", + SerializedName = @"recommendation", + PossibleTypes = new [] { typeof(string) })] + string Recommendation { get; set; } + /// Reason for resolving the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Reason for resolving the alert", + SerializedName = @"resolutionReason", + PossibleTypes = new [] { typeof(string) })] + string ResolutionReason { get; set; } + /// Device or Resource alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Device or Resource alert", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope Scope { get; set; } + /// Severity of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Severity of the alert", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity Severity { get; set; } + /// Source type of the alert. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source type of the alert.", + SerializedName = @"alertSourceType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? SourceAlertSourceType { get; set; } + /// Name of the source. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the source.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string SourceName { get; set; } + /// The time zone. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time zone.", + SerializedName = @"timeZone", + PossibleTypes = new [] { typeof(string) })] + string SourceTimeZone { get; set; } + /// Current status of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Current status of the alert", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus Status { get; set; } + /// Title of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Title of the alert", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Alert class + internal partial interface IAlertInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// Type of the alert + string AlertType { get; set; } + /// UTC time at which the alert appeared on the source + global::System.DateTime AppearedAtSourceTime { get; set; } + /// UTC time at which the alert appeared + global::System.DateTime AppearedAtTime { get; set; } + /// UTC time at which the alert was cleared on the source + global::System.DateTime? ClearedAtSourceTime { get; set; } + /// UTC time at which the alert got cleared + global::System.DateTime? ClearedAtTime { get; set; } + /// Other information about the alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation DetailedInformation { get; set; } + /// ErrorDetails of the alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails ErrorDetail { get; set; } + /// Error code. + string ErrorDetailErrorCode { get; set; } + /// Error Message + string ErrorDetailErrorMessage { get; set; } + /// Number of occurrences. + int? ErrorDetailOccurence { get; set; } + /// Properties of alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties Property { get; set; } + /// Recommendation for acting on the alert + string Recommendation { get; set; } + /// Reason for resolving the alert + string ResolutionReason { get; set; } + /// Device or Resource alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope Scope { get; set; } + /// Severity of the alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity Severity { get; set; } + /// Source at which the alert was cleared + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource Source { get; set; } + /// Source type of the alert. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? SourceAlertSourceType { get; set; } + /// Name of the source. + string SourceName { get; set; } + /// The time zone. + string SourceTimeZone { get; set; } + /// Current status of the alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus Status { get; set; } + /// Title of the alert + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Alert.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Alert.json.cs new file mode 100644 index 000000000000..2bfecc3d3676 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Alert.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Alert class + public partial class Alert + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal Alert(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new Alert(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertErrorDetails.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertErrorDetails.PowerShell.cs new file mode 100644 index 000000000000..1c7655a1cdc7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertErrorDetails.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Error details for the alert + [System.ComponentModel.TypeConverter(typeof(AlertErrorDetailsTypeConverter))] + public partial class AlertErrorDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AlertErrorDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)this).ErrorCode = (string) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)this).ErrorCode, global::System.Convert.ToString); + } + if (content.Contains("ErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)this).ErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("Occurence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)this).Occurence = (int?) content.GetValueForProperty("Occurence",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)this).Occurence, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertErrorDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)this).ErrorCode = (string) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)this).ErrorCode, global::System.Convert.ToString); + } + if (content.Contains("ErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)this).ErrorMessage = (string) content.GetValueForProperty("ErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)this).ErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("Occurence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)this).Occurence = (int?) content.GetValueForProperty("Occurence",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)this).Occurence, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AlertErrorDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertErrorDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Error details for the alert + [System.ComponentModel.TypeConverter(typeof(AlertErrorDetailsTypeConverter))] + public partial interface IAlertErrorDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertErrorDetails.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertErrorDetails.TypeConverter.cs new file mode 100644 index 000000000000..0b763cb9a911 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertErrorDetails.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertErrorDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AlertErrorDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AlertErrorDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AlertErrorDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertErrorDetails.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertErrorDetails.cs new file mode 100644 index 000000000000..1978a993e256 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertErrorDetails.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Error details for the alert + public partial class AlertErrorDetails : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal + { + + /// Backing field for property. + private string _errorCode; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ErrorCode { get => this._errorCode; set => this._errorCode = value; } + + /// Backing field for property. + private string _errorMessage; + + /// Error Message + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ErrorMessage { get => this._errorMessage; set => this._errorMessage = value; } + + /// Backing field for property. + private int? _occurence; + + /// Number of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? Occurence { get => this._occurence; set => this._occurence = value; } + + /// Creates an new instance. + public AlertErrorDetails() + { + + } + } + /// Error details for the alert + public partial interface IAlertErrorDetails : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code.", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(string) })] + string ErrorCode { get; set; } + /// Error Message + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error Message", + SerializedName = @"errorMessage", + PossibleTypes = new [] { typeof(string) })] + string ErrorMessage { get; set; } + /// Number of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of occurrences.", + SerializedName = @"occurences", + PossibleTypes = new [] { typeof(int) })] + int? Occurence { get; set; } + + } + /// Error details for the alert + internal partial interface IAlertErrorDetailsInternal + + { + /// Error code. + string ErrorCode { get; set; } + /// Error Message + string ErrorMessage { get; set; } + /// Number of occurrences. + int? Occurence { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertErrorDetails.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertErrorDetails.json.cs new file mode 100644 index 000000000000..51c28256ca7e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertErrorDetails.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Error details for the alert + public partial class AlertErrorDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AlertErrorDetails(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_errorCode = If( json?.PropertyT("errorCode"), out var __jsonErrorCode) ? (string)__jsonErrorCode : (string)ErrorCode;} + {_errorMessage = If( json?.PropertyT("errorMessage"), out var __jsonErrorMessage) ? (string)__jsonErrorMessage : (string)ErrorMessage;} + {_occurence = If( json?.PropertyT("occurences"), out var __jsonOccurences) ? (int?)__jsonOccurences : Occurence;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AlertErrorDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._errorCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._errorCode.ToString()) : null, "errorCode" ,container.Add ); + AddIf( null != (((object)this._errorMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._errorMessage.ToString()) : null, "errorMessage" ,container.Add ); + AddIf( null != this._occurence ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._occurence) : null, "occurences" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertFilter.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertFilter.PowerShell.cs new file mode 100644 index 000000000000..ea4cf474a5bf --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertFilter.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Filters that can be specified on the alert + [System.ComponentModel.TypeConverter(typeof(AlertFilterTypeConverter))] + public partial class AlertFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AlertFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus.CreateFrom); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity.CreateFrom); + } + if (content.Contains("SourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).SourceType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType?) content.GetValueForProperty("SourceType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).SourceType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType.CreateFrom); + } + if (content.Contains("SourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).SourceName = (string) content.GetValueForProperty("SourceName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).SourceName, global::System.Convert.ToString); + } + if (content.Contains("AppearedOnTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).AppearedOnTime = (global::System.DateTime?) content.GetValueForProperty("AppearedOnTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).AppearedOnTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus.CreateFrom); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity.CreateFrom); + } + if (content.Contains("SourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).SourceType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType?) content.GetValueForProperty("SourceType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).SourceType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType.CreateFrom); + } + if (content.Contains("SourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).SourceName = (string) content.GetValueForProperty("SourceName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).SourceName, global::System.Convert.ToString); + } + if (content.Contains("AppearedOnTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).AppearedOnTime = (global::System.DateTime?) content.GetValueForProperty("AppearedOnTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal)this).AppearedOnTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AlertFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Filters that can be specified on the alert + [System.ComponentModel.TypeConverter(typeof(AlertFilterTypeConverter))] + public partial interface IAlertFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertFilter.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertFilter.TypeConverter.cs new file mode 100644 index 000000000000..ad5d3148114f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AlertFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AlertFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AlertFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertFilter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertFilter.cs new file mode 100644 index 000000000000..e55dafd29b91 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertFilter.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Filters that can be specified on the alert + public partial class AlertFilter : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilter, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilterInternal + { + + /// Backing field for property. + private global::System.DateTime? _appearedOnTime; + + /// UTC time on which the alert appeared + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? AppearedOnTime { get => this._appearedOnTime; set => this._appearedOnTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity? _severity; + + /// Severity of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity? Severity { get => this._severity; set => this._severity = value; } + + /// Backing field for property. + private string _sourceName; + + /// Source name of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string SourceName { get => this._sourceName; set => this._sourceName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? _sourceType; + + /// Source of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? SourceType { get => this._sourceType; set => this._sourceType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus? _status; + + /// Status of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus? Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public AlertFilter() + { + + } + } + /// Filters that can be specified on the alert + public partial interface IAlertFilter : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// UTC time on which the alert appeared + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"UTC time on which the alert appeared", + SerializedName = @"appearedOnTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? AppearedOnTime { get; set; } + /// Severity of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Severity of the alert", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity? Severity { get; set; } + /// Source name of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source name of the alert", + SerializedName = @"sourceName", + PossibleTypes = new [] { typeof(string) })] + string SourceName { get; set; } + /// Source of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source of the alert", + SerializedName = @"sourceType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? SourceType { get; set; } + /// Status of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Status of the alert", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus? Status { get; set; } + + } + /// Filters that can be specified on the alert + internal partial interface IAlertFilterInternal + + { + /// UTC time on which the alert appeared + global::System.DateTime? AppearedOnTime { get; set; } + /// Severity of the alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity? Severity { get; set; } + /// Source name of the alert + string SourceName { get; set; } + /// Source of the alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? SourceType { get; set; } + /// Status of the alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertFilter.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertFilter.json.cs new file mode 100644 index 000000000000..c589dea78753 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertFilter.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Filters that can be specified on the alert + public partial class AlertFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AlertFilter(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_severity = If( json?.PropertyT("severity"), out var __jsonSeverity) ? (string)__jsonSeverity : (string)Severity;} + {_sourceType = If( json?.PropertyT("sourceType"), out var __jsonSourceType) ? (string)__jsonSourceType : (string)SourceType;} + {_sourceName = If( json?.PropertyT("sourceName"), out var __jsonSourceName) ? (string)__jsonSourceName : (string)SourceName;} + {_appearedOnTime = If( json?.PropertyT("appearedOnTime"), out var __jsonAppearedOnTime) ? global::System.DateTime.TryParse((string)__jsonAppearedOnTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonAppearedOnTimeValue) ? __jsonAppearedOnTimeValue : AppearedOnTime : AppearedOnTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AlertFilter(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._severity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._severity.ToString()) : null, "severity" ,container.Add ); + AddIf( null != (((object)this._sourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._sourceType.ToString()) : null, "sourceType" ,container.Add ); + AddIf( null != (((object)this._sourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._sourceName.ToString()) : null, "sourceName" ,container.Add ); + AddIf( null != this._appearedOnTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._appearedOnTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "appearedOnTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertList.PowerShell.cs new file mode 100644 index 000000000000..889ced9dc548 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertList.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Collection of Alerts + [System.ComponentModel.TypeConverter(typeof(AlertListTypeConverter))] + public partial class AlertList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AlertList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AlertList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of Alerts + [System.ComponentModel.TypeConverter(typeof(AlertListTypeConverter))] + public partial interface IAlertList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertList.TypeConverter.cs new file mode 100644 index 000000000000..c34565adba07 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertList.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AlertList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AlertList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AlertList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertList.cs new file mode 100644 index 000000000000..29a03cdac435 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertList.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of Alerts + public partial class AlertList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// Id of the next page of alerts + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public AlertList() + { + + } + } + /// Collection of Alerts + public partial interface IAlertList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Id of the next page of alerts + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id of the next page of alerts", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert[] Value { get; set; } + + } + /// Collection of Alerts + internal partial interface IAlertListInternal + + { + /// Id of the next page of alerts + string NextLink { get; set; } + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertList.json.cs new file mode 100644 index 000000000000..6520a6da787b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertList.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of Alerts + public partial class AlertList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AlertList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Alert.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AlertList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertProperties.PowerShell.cs new file mode 100644 index 000000000000..97c1fbee2ea0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertProperties.PowerShell.cs @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Properties of alert + [System.ComponentModel.TypeConverter(typeof(AlertPropertiesTypeConverter))] + public partial class AlertProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AlertProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSourceTypeConverter.ConvertFrom); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope.CreateFrom); + } + if (content.Contains("AlertType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).AlertType = (string) content.GetValueForProperty("AlertType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).AlertType, global::System.Convert.ToString); + } + if (content.Contains("AppearedAtTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).AppearedAtTime = (global::System.DateTime) content.GetValueForProperty("AppearedAtTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).AppearedAtTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AppearedAtSourceTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).AppearedAtSourceTime = (global::System.DateTime) content.GetValueForProperty("AppearedAtSourceTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).AppearedAtSourceTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClearedAtTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ClearedAtTime = (global::System.DateTime?) content.GetValueForProperty("ClearedAtTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ClearedAtTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClearedAtSourceTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ClearedAtSourceTime = (global::System.DateTime?) content.GetValueForProperty("ClearedAtSourceTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ClearedAtSourceTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Recommendation = (string) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Recommendation, global::System.Convert.ToString); + } + if (content.Contains("ResolutionReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ResolutionReason = (string) content.GetValueForProperty("ResolutionReason",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ResolutionReason, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity.CreateFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus.CreateFrom); + } + if (content.Contains("DetailedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).DetailedInformation = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation) content.GetValueForProperty("DetailedInformation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).DetailedInformation, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertPropertiesDetailedInformationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).SourceName = (string) content.GetValueForProperty("SourceName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).SourceName, global::System.Convert.ToString); + } + if (content.Contains("SourceTimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).SourceTimeZone = (string) content.GetValueForProperty("SourceTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).SourceTimeZone, global::System.Convert.ToString); + } + if (content.Contains("SourceAlertSourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).SourceAlertSourceType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType?) content.GetValueForProperty("SourceAlertSourceType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).SourceAlertSourceType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType.CreateFrom); + } + if (content.Contains("ErrorDetailErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetailErrorCode = (string) content.GetValueForProperty("ErrorDetailErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetailErrorCode, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetailErrorMessage = (string) content.GetValueForProperty("ErrorDetailErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetailErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailOccurence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetailOccurence = (int?) content.GetValueForProperty("ErrorDetailOccurence",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetailOccurence, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSourceTypeConverter.ConvertFrom); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetail, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Title")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Title, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope.CreateFrom); + } + if (content.Contains("AlertType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).AlertType = (string) content.GetValueForProperty("AlertType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).AlertType, global::System.Convert.ToString); + } + if (content.Contains("AppearedAtTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).AppearedAtTime = (global::System.DateTime) content.GetValueForProperty("AppearedAtTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).AppearedAtTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AppearedAtSourceTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).AppearedAtSourceTime = (global::System.DateTime) content.GetValueForProperty("AppearedAtSourceTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).AppearedAtSourceTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClearedAtTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ClearedAtTime = (global::System.DateTime?) content.GetValueForProperty("ClearedAtTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ClearedAtTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ClearedAtSourceTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ClearedAtSourceTime = (global::System.DateTime?) content.GetValueForProperty("ClearedAtSourceTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ClearedAtSourceTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Recommendation = (string) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Recommendation, global::System.Convert.ToString); + } + if (content.Contains("ResolutionReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ResolutionReason = (string) content.GetValueForProperty("ResolutionReason",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ResolutionReason, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Severity = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Severity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity.CreateFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus.CreateFrom); + } + if (content.Contains("DetailedInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).DetailedInformation = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation) content.GetValueForProperty("DetailedInformation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).DetailedInformation, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertPropertiesDetailedInformationTypeConverter.ConvertFrom); + } + if (content.Contains("SourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).SourceName = (string) content.GetValueForProperty("SourceName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).SourceName, global::System.Convert.ToString); + } + if (content.Contains("SourceTimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).SourceTimeZone = (string) content.GetValueForProperty("SourceTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).SourceTimeZone, global::System.Convert.ToString); + } + if (content.Contains("SourceAlertSourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).SourceAlertSourceType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType?) content.GetValueForProperty("SourceAlertSourceType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).SourceAlertSourceType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType.CreateFrom); + } + if (content.Contains("ErrorDetailErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetailErrorCode = (string) content.GetValueForProperty("ErrorDetailErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetailErrorCode, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailErrorMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetailErrorMessage = (string) content.GetValueForProperty("ErrorDetailErrorMessage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetailErrorMessage, global::System.Convert.ToString); + } + if (content.Contains("ErrorDetailOccurence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetailOccurence = (int?) content.GetValueForProperty("ErrorDetailOccurence",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal)this).ErrorDetailOccurence, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AlertProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of alert + [System.ComponentModel.TypeConverter(typeof(AlertPropertiesTypeConverter))] + public partial interface IAlertProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertProperties.TypeConverter.cs new file mode 100644 index 000000000000..9eb42a71fd6f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AlertProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AlertProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AlertProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertProperties.cs new file mode 100644 index 000000000000..f20eea6c413a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertProperties.cs @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Properties of alert + public partial class AlertProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal + { + + /// Backing field for property. + private string _alertType; + + /// Type of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string AlertType { get => this._alertType; set => this._alertType = value; } + + /// Backing field for property. + private global::System.DateTime _appearedAtSourceTime; + + /// UTC time at which the alert appeared on the source + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime AppearedAtSourceTime { get => this._appearedAtSourceTime; set => this._appearedAtSourceTime = value; } + + /// Backing field for property. + private global::System.DateTime _appearedAtTime; + + /// UTC time at which the alert appeared + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime AppearedAtTime { get => this._appearedAtTime; set => this._appearedAtTime = value; } + + /// Backing field for property. + private global::System.DateTime? _clearedAtSourceTime; + + /// UTC time at which the alert was cleared on the source + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? ClearedAtSourceTime { get => this._clearedAtSourceTime; set => this._clearedAtSourceTime = value; } + + /// Backing field for property. + private global::System.DateTime? _clearedAtTime; + + /// UTC time at which the alert got cleared + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? ClearedAtTime { get => this._clearedAtTime; set => this._clearedAtTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation _detailedInformation; + + /// Other information about the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation DetailedInformation { get => (this._detailedInformation = this._detailedInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertPropertiesDetailedInformation()); set => this._detailedInformation = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails _errorDetail; + + /// ErrorDetails of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails ErrorDetail { get => (this._errorDetail = this._errorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertErrorDetails()); set => this._errorDetail = value; } + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ErrorDetailErrorCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)ErrorDetail).ErrorCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)ErrorDetail).ErrorCode = value ?? null; } + + /// Error Message + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ErrorDetailErrorMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)ErrorDetail).ErrorMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)ErrorDetail).ErrorMessage = value ?? null; } + + /// Number of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? ErrorDetailOccurence { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)ErrorDetail).Occurence; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetailsInternal)ErrorDetail).Occurence = value ?? default(int); } + + /// Internal Acessors for ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal.ErrorDetail { get => (this._errorDetail = this._errorDetail ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertErrorDetails()); set { {_errorDetail = value;} } } + + /// Internal Acessors for Source + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesInternal.Source { get => (this._source = this._source ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSource()); set { {_source = value;} } } + + /// Backing field for property. + private string _recommendation; + + /// Recommendation for acting on the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Recommendation { get => this._recommendation; set => this._recommendation = value; } + + /// Backing field for property. + private string _resolutionReason; + + /// Reason for resolving the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ResolutionReason { get => this._resolutionReason; set => this._resolutionReason = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope _scope; + + /// Device or Resource alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity _severity; + + /// Severity of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity Severity { get => this._severity; set => this._severity = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource _source; + + /// Source at which the alert was cleared + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource Source { get => (this._source = this._source ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSource()); set => this._source = value; } + + /// Source type of the alert. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? SourceAlertSourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)Source).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)Source).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType)""); } + + /// Name of the source. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string SourceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)Source).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)Source).Name = value ?? null; } + + /// The time zone. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string SourceTimeZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)Source).TimeZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)Source).TimeZone = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus _status; + + /// Current status of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private string _title; + + /// Title of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Title { get => this._title; set => this._title = value; } + + /// Creates an new instance. + public AlertProperties() + { + + } + } + /// Properties of alert + public partial interface IAlertProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Type of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the alert", + SerializedName = @"alertType", + PossibleTypes = new [] { typeof(string) })] + string AlertType { get; set; } + /// UTC time at which the alert appeared on the source + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"UTC time at which the alert appeared on the source", + SerializedName = @"appearedAtSourceTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime AppearedAtSourceTime { get; set; } + /// UTC time at which the alert appeared + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"UTC time at which the alert appeared", + SerializedName = @"appearedAtTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime AppearedAtTime { get; set; } + /// UTC time at which the alert was cleared on the source + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"UTC time at which the alert was cleared on the source", + SerializedName = @"clearedAtSourceTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ClearedAtSourceTime { get; set; } + /// UTC time at which the alert got cleared + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"UTC time at which the alert got cleared", + SerializedName = @"clearedAtTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ClearedAtTime { get; set; } + /// Other information about the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Other information about the alert", + SerializedName = @"detailedInformation", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation DetailedInformation { get; set; } + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error code.", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailErrorCode { get; set; } + /// Error Message + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error Message", + SerializedName = @"errorMessage", + PossibleTypes = new [] { typeof(string) })] + string ErrorDetailErrorMessage { get; set; } + /// Number of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of occurrences.", + SerializedName = @"occurences", + PossibleTypes = new [] { typeof(int) })] + int? ErrorDetailOccurence { get; set; } + /// Recommendation for acting on the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Recommendation for acting on the alert", + SerializedName = @"recommendation", + PossibleTypes = new [] { typeof(string) })] + string Recommendation { get; set; } + /// Reason for resolving the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Reason for resolving the alert", + SerializedName = @"resolutionReason", + PossibleTypes = new [] { typeof(string) })] + string ResolutionReason { get; set; } + /// Device or Resource alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Device or Resource alert", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope Scope { get; set; } + /// Severity of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Severity of the alert", + SerializedName = @"severity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity Severity { get; set; } + /// Source type of the alert. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source type of the alert.", + SerializedName = @"alertSourceType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? SourceAlertSourceType { get; set; } + /// Name of the source. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the source.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string SourceName { get; set; } + /// The time zone. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time zone.", + SerializedName = @"timeZone", + PossibleTypes = new [] { typeof(string) })] + string SourceTimeZone { get; set; } + /// Current status of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Current status of the alert", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus Status { get; set; } + /// Title of the alert + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Title of the alert", + SerializedName = @"title", + PossibleTypes = new [] { typeof(string) })] + string Title { get; set; } + + } + /// Properties of alert + internal partial interface IAlertPropertiesInternal + + { + /// Type of the alert + string AlertType { get; set; } + /// UTC time at which the alert appeared on the source + global::System.DateTime AppearedAtSourceTime { get; set; } + /// UTC time at which the alert appeared + global::System.DateTime AppearedAtTime { get; set; } + /// UTC time at which the alert was cleared on the source + global::System.DateTime? ClearedAtSourceTime { get; set; } + /// UTC time at which the alert got cleared + global::System.DateTime? ClearedAtTime { get; set; } + /// Other information about the alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation DetailedInformation { get; set; } + /// ErrorDetails of the alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertErrorDetails ErrorDetail { get; set; } + /// Error code. + string ErrorDetailErrorCode { get; set; } + /// Error Message + string ErrorDetailErrorMessage { get; set; } + /// Number of occurrences. + int? ErrorDetailOccurence { get; set; } + /// Recommendation for acting on the alert + string Recommendation { get; set; } + /// Reason for resolving the alert + string ResolutionReason { get; set; } + /// Device or Resource alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope Scope { get; set; } + /// Severity of the alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity Severity { get; set; } + /// Source at which the alert was cleared + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource Source { get; set; } + /// Source type of the alert. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? SourceAlertSourceType { get; set; } + /// Name of the source. + string SourceName { get; set; } + /// The time zone. + string SourceTimeZone { get; set; } + /// Current status of the alert + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus Status { get; set; } + /// Title of the alert + string Title { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertProperties.json.cs new file mode 100644 index 000000000000..a2ff7dad817d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertProperties.json.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Properties of alert + public partial class AlertProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AlertProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_source = If( json?.PropertyT("source"), out var __jsonSource) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSource.FromJson(__jsonSource) : Source;} + {_errorDetail = If( json?.PropertyT("errorDetails"), out var __jsonErrorDetails) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertErrorDetails.FromJson(__jsonErrorDetails) : ErrorDetail;} + {_title = If( json?.PropertyT("title"), out var __jsonTitle) ? (string)__jsonTitle : (string)Title;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_alertType = If( json?.PropertyT("alertType"), out var __jsonAlertType) ? (string)__jsonAlertType : (string)AlertType;} + {_appearedAtTime = If( json?.PropertyT("appearedAtTime"), out var __jsonAppearedAtTime) ? global::System.DateTime.TryParse((string)__jsonAppearedAtTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonAppearedAtTimeValue) ? __jsonAppearedAtTimeValue : AppearedAtTime : AppearedAtTime;} + {_appearedAtSourceTime = If( json?.PropertyT("appearedAtSourceTime"), out var __jsonAppearedAtSourceTime) ? global::System.DateTime.TryParse((string)__jsonAppearedAtSourceTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonAppearedAtSourceTimeValue) ? __jsonAppearedAtSourceTimeValue : AppearedAtSourceTime : AppearedAtSourceTime;} + {_clearedAtTime = If( json?.PropertyT("clearedAtTime"), out var __jsonClearedAtTime) ? global::System.DateTime.TryParse((string)__jsonClearedAtTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonClearedAtTimeValue) ? __jsonClearedAtTimeValue : ClearedAtTime : ClearedAtTime;} + {_clearedAtSourceTime = If( json?.PropertyT("clearedAtSourceTime"), out var __jsonClearedAtSourceTime) ? global::System.DateTime.TryParse((string)__jsonClearedAtSourceTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonClearedAtSourceTimeValue) ? __jsonClearedAtSourceTimeValue : ClearedAtSourceTime : ClearedAtSourceTime;} + {_recommendation = If( json?.PropertyT("recommendation"), out var __jsonRecommendation) ? (string)__jsonRecommendation : (string)Recommendation;} + {_resolutionReason = If( json?.PropertyT("resolutionReason"), out var __jsonResolutionReason) ? (string)__jsonResolutionReason : (string)ResolutionReason;} + {_severity = If( json?.PropertyT("severity"), out var __jsonSeverity) ? (string)__jsonSeverity : (string)Severity;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_detailedInformation = If( json?.PropertyT("detailedInformation"), out var __jsonDetailedInformation) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertPropertiesDetailedInformation.FromJson(__jsonDetailedInformation) : DetailedInformation;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AlertProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._source ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._source.ToJson(null,serializationMode) : null, "source" ,container.Add ); + AddIf( null != this._errorDetail ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._errorDetail.ToJson(null,serializationMode) : null, "errorDetails" ,container.Add ); + AddIf( null != (((object)this._title)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._title.ToString()) : null, "title" ,container.Add ); + AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + AddIf( null != (((object)this._alertType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._alertType.ToString()) : null, "alertType" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._appearedAtTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "appearedAtTime" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._appearedAtSourceTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "appearedAtSourceTime" ,container.Add ); + AddIf( null != this._clearedAtTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._clearedAtTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "clearedAtTime" ,container.Add ); + AddIf( null != this._clearedAtSourceTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._clearedAtSourceTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "clearedAtSourceTime" ,container.Add ); + AddIf( null != (((object)this._recommendation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._recommendation.ToString()) : null, "recommendation" ,container.Add ); + AddIf( null != (((object)this._resolutionReason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._resolutionReason.ToString()) : null, "resolutionReason" ,container.Add ); + AddIf( null != (((object)this._severity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._severity.ToString()) : null, "severity" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != this._detailedInformation ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._detailedInformation.ToJson(null,serializationMode) : null, "detailedInformation" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.PowerShell.cs new file mode 100644 index 000000000000..a5b03930c160 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Other information about the alert + [System.ComponentModel.TypeConverter(typeof(AlertPropertiesDetailedInformationTypeConverter))] + public partial class AlertPropertiesDetailedInformation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AlertPropertiesDetailedInformation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertPropertiesDetailedInformation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AlertPropertiesDetailedInformation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertPropertiesDetailedInformation(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Other information about the alert + [System.ComponentModel.TypeConverter(typeof(AlertPropertiesDetailedInformationTypeConverter))] + public partial interface IAlertPropertiesDetailedInformation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.TypeConverter.cs new file mode 100644 index 000000000000..a6ea3cdef5fb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertPropertiesDetailedInformationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AlertPropertiesDetailedInformation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AlertPropertiesDetailedInformation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AlertPropertiesDetailedInformation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.cs new file mode 100644 index 000000000000..7091c5fe3a71 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Other information about the alert + public partial class AlertPropertiesDetailedInformation : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformationInternal + { + + /// Creates an new instance. + public AlertPropertiesDetailedInformation() + { + + } + } + /// Other information about the alert + public partial interface IAlertPropertiesDetailedInformation : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray + { + + } + /// Other information about the alert + internal partial interface IAlertPropertiesDetailedInformationInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.dictionary.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.dictionary.cs new file mode 100644 index 000000000000..7435a2949351 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + public partial class AlertPropertiesDetailedInformation : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertPropertiesDetailedInformation source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.json.cs new file mode 100644 index 000000000000..ed0b4119ffb3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertPropertiesDetailedInformation.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Other information about the alert + public partial class AlertPropertiesDetailedInformation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + /// + internal AlertPropertiesDetailedInformation(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertPropertiesDetailedInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AlertPropertiesDetailedInformation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettings.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettings.PowerShell.cs new file mode 100644 index 000000000000..bb1016477c68 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettings.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// AlertSettings on the device which represents how alerts will be processed + [System.ComponentModel.TypeConverter(typeof(AlertSettingsTypeConverter))] + public partial class AlertSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AlertSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("EmailNotification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).EmailNotification = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus) content.GetValueForProperty("EmailNotification",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).EmailNotification, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus.CreateFrom); + } + if (content.Contains("NotificationToServiceOwner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).NotificationToServiceOwner = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus) content.GetValueForProperty("NotificationToServiceOwner",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).NotificationToServiceOwner, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus.CreateFrom); + } + if (content.Contains("AlertNotificationCulture")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).AlertNotificationCulture = (string) content.GetValueForProperty("AlertNotificationCulture",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).AlertNotificationCulture, global::System.Convert.ToString); + } + if (content.Contains("AdditionalRecipientEmailList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).AdditionalRecipientEmailList = (string[]) content.GetValueForProperty("AdditionalRecipientEmailList",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).AdditionalRecipientEmailList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("EmailNotification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).EmailNotification = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus) content.GetValueForProperty("EmailNotification",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).EmailNotification, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus.CreateFrom); + } + if (content.Contains("NotificationToServiceOwner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).NotificationToServiceOwner = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus) content.GetValueForProperty("NotificationToServiceOwner",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).NotificationToServiceOwner, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus.CreateFrom); + } + if (content.Contains("AlertNotificationCulture")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).AlertNotificationCulture = (string) content.GetValueForProperty("AlertNotificationCulture",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).AlertNotificationCulture, global::System.Convert.ToString); + } + if (content.Contains("AdditionalRecipientEmailList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).AdditionalRecipientEmailList = (string[]) content.GetValueForProperty("AdditionalRecipientEmailList",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal)this).AdditionalRecipientEmailList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AlertSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// AlertSettings on the device which represents how alerts will be processed + [System.ComponentModel.TypeConverter(typeof(AlertSettingsTypeConverter))] + public partial interface IAlertSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettings.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettings.TypeConverter.cs new file mode 100644 index 000000000000..e4b419beb5f9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettings.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AlertSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AlertSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AlertSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettings.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettings.cs new file mode 100644 index 000000000000..e405077713b6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettings.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// AlertSettings on the device which represents how alerts will be processed + public partial class AlertSettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// + /// List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string[] AdditionalRecipientEmailList { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)Property).AdditionalRecipientEmailList; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)Property).AdditionalRecipientEmailList = value ?? null /* arrayOf */; } + + /// Culture setting to be used while building alert emails. For eg: "en-US" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string AlertNotificationCulture { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)Property).AlertNotificationCulture; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)Property).AlertNotificationCulture = value ; } + + /// + /// Value indicating whether user/admins will receive emails when an alert condition occurs on the system + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus EmailNotification { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)Property).EmailNotification; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)Property).EmailNotification = value ; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSettingsProperties()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// + /// Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only + /// if emailNotification flag is Enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus NotificationToServiceOwner { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)Property).NotificationToServiceOwner; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)Property).NotificationToServiceOwner = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties _property; + + /// Properties of AlertSettings + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSettingsProperties()); set => this._property = value; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public AlertSettings() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// AlertSettings on the device which represents how alerts will be processed + public partial interface IAlertSettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// + /// List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent", + SerializedName = @"additionalRecipientEmailList", + PossibleTypes = new [] { typeof(string) })] + string[] AdditionalRecipientEmailList { get; set; } + /// Culture setting to be used while building alert emails. For eg: "en-US" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Culture setting to be used while building alert emails. For eg: ""en-US""", + SerializedName = @"alertNotificationCulture", + PossibleTypes = new [] { typeof(string) })] + string AlertNotificationCulture { get; set; } + /// + /// Value indicating whether user/admins will receive emails when an alert condition occurs on the system + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Value indicating whether user/admins will receive emails when an alert condition occurs on the system", + SerializedName = @"emailNotification", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus EmailNotification { get; set; } + /// + /// Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only + /// if emailNotification flag is Enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only if emailNotification flag is Enabled.", + SerializedName = @"notificationToServiceOwners", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus NotificationToServiceOwner { get; set; } + + } + /// AlertSettings on the device which represents how alerts will be processed + internal partial interface IAlertSettingsInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// + /// List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent + /// + string[] AdditionalRecipientEmailList { get; set; } + /// Culture setting to be used while building alert emails. For eg: "en-US" + string AlertNotificationCulture { get; set; } + /// + /// Value indicating whether user/admins will receive emails when an alert condition occurs on the system + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus EmailNotification { get; set; } + /// + /// Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only + /// if emailNotification flag is Enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus NotificationToServiceOwner { get; set; } + /// Properties of AlertSettings + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettings.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettings.json.cs new file mode 100644 index 000000000000..0a08f4925ab0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettings.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// AlertSettings on the device which represents how alerts will be processed + public partial class AlertSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AlertSettings(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSettingsProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AlertSettings(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettingsProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettingsProperties.PowerShell.cs new file mode 100644 index 000000000000..80b582b76390 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettingsProperties.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Class containing the properties of AlertSettings + [System.ComponentModel.TypeConverter(typeof(AlertSettingsPropertiesTypeConverter))] + public partial class AlertSettingsProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AlertSettingsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EmailNotification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).EmailNotification = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus) content.GetValueForProperty("EmailNotification",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).EmailNotification, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus.CreateFrom); + } + if (content.Contains("NotificationToServiceOwner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).NotificationToServiceOwner = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus) content.GetValueForProperty("NotificationToServiceOwner",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).NotificationToServiceOwner, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus.CreateFrom); + } + if (content.Contains("AlertNotificationCulture")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).AlertNotificationCulture = (string) content.GetValueForProperty("AlertNotificationCulture",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).AlertNotificationCulture, global::System.Convert.ToString); + } + if (content.Contains("AdditionalRecipientEmailList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).AdditionalRecipientEmailList = (string[]) content.GetValueForProperty("AdditionalRecipientEmailList",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).AdditionalRecipientEmailList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertSettingsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EmailNotification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).EmailNotification = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus) content.GetValueForProperty("EmailNotification",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).EmailNotification, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus.CreateFrom); + } + if (content.Contains("NotificationToServiceOwner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).NotificationToServiceOwner = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus) content.GetValueForProperty("NotificationToServiceOwner",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).NotificationToServiceOwner, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus.CreateFrom); + } + if (content.Contains("AlertNotificationCulture")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).AlertNotificationCulture = (string) content.GetValueForProperty("AlertNotificationCulture",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).AlertNotificationCulture, global::System.Convert.ToString); + } + if (content.Contains("AdditionalRecipientEmailList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).AdditionalRecipientEmailList = (string[]) content.GetValueForProperty("AdditionalRecipientEmailList",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal)this).AdditionalRecipientEmailList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AlertSettingsProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertSettingsProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Class containing the properties of AlertSettings + [System.ComponentModel.TypeConverter(typeof(AlertSettingsPropertiesTypeConverter))] + public partial interface IAlertSettingsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettingsProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettingsProperties.TypeConverter.cs new file mode 100644 index 000000000000..d3882eddbf73 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettingsProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertSettingsPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AlertSettingsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AlertSettingsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AlertSettingsProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettingsProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettingsProperties.cs new file mode 100644 index 000000000000..097dee164810 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettingsProperties.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class containing the properties of AlertSettings + public partial class AlertSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsPropertiesInternal + { + + /// Backing field for property. + private string[] _additionalRecipientEmailList; + + /// + /// List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string[] AdditionalRecipientEmailList { get => this._additionalRecipientEmailList; set => this._additionalRecipientEmailList = value; } + + /// Backing field for property. + private string _alertNotificationCulture; + + /// Culture setting to be used while building alert emails. For eg: "en-US" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string AlertNotificationCulture { get => this._alertNotificationCulture; set => this._alertNotificationCulture = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus _emailNotification; + + /// + /// Value indicating whether user/admins will receive emails when an alert condition occurs on the system + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus EmailNotification { get => this._emailNotification; set => this._emailNotification = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus _notificationToServiceOwner; + + /// + /// Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only + /// if emailNotification flag is Enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus NotificationToServiceOwner { get => this._notificationToServiceOwner; set => this._notificationToServiceOwner = value; } + + /// Creates an new instance. + public AlertSettingsProperties() + { + + } + } + /// Class containing the properties of AlertSettings + public partial interface IAlertSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// + /// List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent", + SerializedName = @"additionalRecipientEmailList", + PossibleTypes = new [] { typeof(string) })] + string[] AdditionalRecipientEmailList { get; set; } + /// Culture setting to be used while building alert emails. For eg: "en-US" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Culture setting to be used while building alert emails. For eg: ""en-US""", + SerializedName = @"alertNotificationCulture", + PossibleTypes = new [] { typeof(string) })] + string AlertNotificationCulture { get; set; } + /// + /// Value indicating whether user/admins will receive emails when an alert condition occurs on the system + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Value indicating whether user/admins will receive emails when an alert condition occurs on the system", + SerializedName = @"emailNotification", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus EmailNotification { get; set; } + /// + /// Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only + /// if emailNotification flag is Enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only if emailNotification flag is Enabled.", + SerializedName = @"notificationToServiceOwners", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus NotificationToServiceOwner { get; set; } + + } + /// Class containing the properties of AlertSettings + internal partial interface IAlertSettingsPropertiesInternal + + { + /// + /// List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent + /// + string[] AdditionalRecipientEmailList { get; set; } + /// Culture setting to be used while building alert emails. For eg: "en-US" + string AlertNotificationCulture { get; set; } + /// + /// Value indicating whether user/admins will receive emails when an alert condition occurs on the system + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus EmailNotification { get; set; } + /// + /// Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only + /// if emailNotification flag is Enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus NotificationToServiceOwner { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettingsProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettingsProperties.json.cs new file mode 100644 index 000000000000..878537a5a921 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSettingsProperties.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class containing the properties of AlertSettings + public partial class AlertSettingsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AlertSettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_emailNotification = If( json?.PropertyT("emailNotification"), out var __jsonEmailNotification) ? (string)__jsonEmailNotification : (string)EmailNotification;} + {_notificationToServiceOwner = If( json?.PropertyT("notificationToServiceOwners"), out var __jsonNotificationToServiceOwners) ? (string)__jsonNotificationToServiceOwners : (string)NotificationToServiceOwner;} + {_alertNotificationCulture = If( json?.PropertyT("alertNotificationCulture"), out var __jsonAlertNotificationCulture) ? (string)__jsonAlertNotificationCulture : (string)AlertNotificationCulture;} + {_additionalRecipientEmailList = If( json?.PropertyT("additionalRecipientEmailList"), out var __jsonAdditionalRecipientEmailList) ? If( __jsonAdditionalRecipientEmailList as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AdditionalRecipientEmailList;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AlertSettingsProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._emailNotification)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._emailNotification.ToString()) : null, "emailNotification" ,container.Add ); + AddIf( null != (((object)this._notificationToServiceOwner)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._notificationToServiceOwner.ToString()) : null, "notificationToServiceOwners" ,container.Add ); + AddIf( null != (((object)this._alertNotificationCulture)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._alertNotificationCulture.ToString()) : null, "alertNotificationCulture" ,container.Add ); + if (null != this._additionalRecipientEmailList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._additionalRecipientEmailList ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("additionalRecipientEmailList",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSource.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSource.PowerShell.cs new file mode 100644 index 000000000000..7e162f2bfcb8 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSource.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// source at which the alert can be raised + [System.ComponentModel.TypeConverter(typeof(AlertSourceTypeConverter))] + public partial class AlertSource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AlertSource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("TimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)this).TimeZone, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertSource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("TimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)this).TimeZone, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AlertSource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertSource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// source at which the alert can be raised + [System.ComponentModel.TypeConverter(typeof(AlertSourceTypeConverter))] + public partial interface IAlertSource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSource.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSource.TypeConverter.cs new file mode 100644 index 000000000000..4fd5298db5fb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSource.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertSourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AlertSource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AlertSource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AlertSource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSource.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSource.cs new file mode 100644 index 000000000000..687cda42fe63 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSource.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// source at which the alert can be raised + public partial class AlertSource : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSourceInternal + { + + /// Backing field for property. + private string _name; + + /// Name of the source. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _timeZone; + + /// The time zone. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string TimeZone { get => this._timeZone; set => this._timeZone = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? _type; + + /// Source type of the alert. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public AlertSource() + { + + } + } + /// source at which the alert can be raised + public partial interface IAlertSource : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Name of the source. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the source.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The time zone. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time zone.", + SerializedName = @"timeZone", + PossibleTypes = new [] { typeof(string) })] + string TimeZone { get; set; } + /// Source type of the alert. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source type of the alert.", + SerializedName = @"alertSourceType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? Type { get; set; } + + } + /// source at which the alert can be raised + internal partial interface IAlertSourceInternal + + { + /// Name of the source. + string Name { get; set; } + /// The time zone. + string TimeZone { get; set; } + /// Source type of the alert. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSource.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSource.json.cs new file mode 100644 index 000000000000..deac1dcba9f7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AlertSource.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// source at which the alert can be raised + public partial class AlertSource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AlertSource(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_timeZone = If( json?.PropertyT("timeZone"), out var __jsonTimeZone) ? (string)__jsonTimeZone : (string)TimeZone;} + {_type = If( json?.PropertyT("alertSourceType"), out var __jsonAlertSourceType) ? (string)__jsonAlertSourceType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSource FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AlertSource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._timeZone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._timeZone.ToString()) : null, "timeZone" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._type.ToString()) : null, "alertSourceType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AsymmetricEncryptedSecret.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AsymmetricEncryptedSecret.PowerShell.cs new file mode 100644 index 000000000000..d0e453ea3932 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AsymmetricEncryptedSecret.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// This class can be used as the Type for any secret entity represented as Password, CertThumbprint, Algorithm. This class + /// is intended to be used when the secret is encrypted with an asymmetric key pair. The encryptionAlgorithm field is mainly + /// for future usage to potentially allow different entities encrypted using different algorithms. + /// + [System.ComponentModel.TypeConverter(typeof(AsymmetricEncryptedSecretTypeConverter))] + public partial class AsymmetricEncryptedSecret + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AsymmetricEncryptedSecret(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("EncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)this).EncryptionCertificateThumbprint = (string) content.GetValueForProperty("EncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)this).EncryptionCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("EncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)this).EncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)this).EncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AsymmetricEncryptedSecret(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("EncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)this).EncryptionCertificateThumbprint = (string) content.GetValueForProperty("EncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)this).EncryptionCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("EncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)this).EncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)this).EncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AsymmetricEncryptedSecret(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AsymmetricEncryptedSecret(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// This class can be used as the Type for any secret entity represented as Password, CertThumbprint, Algorithm. This class + /// is intended to be used when the secret is encrypted with an asymmetric key pair. The encryptionAlgorithm field is mainly + /// for future usage to potentially allow different entities encrypted using different algorithms. + [System.ComponentModel.TypeConverter(typeof(AsymmetricEncryptedSecretTypeConverter))] + public partial interface IAsymmetricEncryptedSecret + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AsymmetricEncryptedSecret.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AsymmetricEncryptedSecret.TypeConverter.cs new file mode 100644 index 000000000000..6908c785c312 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AsymmetricEncryptedSecret.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AsymmetricEncryptedSecretTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AsymmetricEncryptedSecret.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AsymmetricEncryptedSecret.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AsymmetricEncryptedSecret.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AsymmetricEncryptedSecret.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AsymmetricEncryptedSecret.cs new file mode 100644 index 000000000000..d4592f4f1b71 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AsymmetricEncryptedSecret.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// + /// This class can be used as the Type for any secret entity represented as Password, CertThumbprint, Algorithm. This class + /// is intended to be used when the secret is encrypted with an asymmetric key pair. The encryptionAlgorithm field is mainly + /// for future usage to potentially allow different entities encrypted using different algorithms. + /// + public partial class AsymmetricEncryptedSecret : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm _encryptionAlgorithm; + + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm EncryptionAlgorithm { get => this._encryptionAlgorithm; set => this._encryptionAlgorithm = value; } + + /// Backing field for property. + private string _encryptionCertificateThumbprint; + + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string EncryptionCertificateThumbprint { get => this._encryptionCertificateThumbprint; set => this._encryptionCertificateThumbprint = value; } + + /// Backing field for property. + private string _value; + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public AsymmetricEncryptedSecret() + { + + } + } + /// This class can be used as the Type for any secret entity represented as Password, CertThumbprint, Algorithm. This class + /// is intended to be used when the secret is encrypted with an asymmetric key pair. The encryptionAlgorithm field is mainly + /// for future usage to potentially allow different entities encrypted using different algorithms. + public partial interface IAsymmetricEncryptedSecret : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm EncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + string EncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// This class can be used as the Type for any secret entity represented as Password, CertThumbprint, Algorithm. This class + /// is intended to be used when the secret is encrypted with an asymmetric key pair. The encryptionAlgorithm field is mainly + /// for future usage to potentially allow different entities encrypted using different algorithms. + internal partial interface IAsymmetricEncryptedSecretInternal + + { + /// Algorithm used to encrypt "Value" + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm EncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + string EncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AsymmetricEncryptedSecret.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AsymmetricEncryptedSecret.json.cs new file mode 100644 index 000000000000..9db13e7a8c98 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AsymmetricEncryptedSecret.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// + /// This class can be used as the Type for any secret entity represented as Password, CertThumbprint, Algorithm. This class + /// is intended to be used when the secret is encrypted with an asymmetric key pair. The encryptionAlgorithm field is mainly + /// for future usage to potentially allow different entities encrypted using different algorithms. + /// + public partial class AsymmetricEncryptedSecret + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AsymmetricEncryptedSecret(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_encryptionCertificateThumbprint = If( json?.PropertyT("encryptionCertificateThumbprint"), out var __jsonEncryptionCertificateThumbprint) ? (string)__jsonEncryptionCertificateThumbprint : (string)EncryptionCertificateThumbprint;} + {_encryptionAlgorithm = If( json?.PropertyT("encryptionAlgorithm"), out var __jsonEncryptionAlgorithm) ? (string)__jsonEncryptionAlgorithm : (string)EncryptionAlgorithm;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AsymmetricEncryptedSecret(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AddIf( null != (((object)this._encryptionCertificateThumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._encryptionCertificateThumbprint.ToString()) : null, "encryptionCertificateThumbprint" ,container.Add ); + AddIf( null != (((object)this._encryptionAlgorithm)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._encryptionAlgorithm.ToString()) : null, "encryptionAlgorithm" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperation.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperation.PowerShell.cs new file mode 100644 index 000000000000..aefc6964e12b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperation.PowerShell.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Class represents provider operation + [System.ComponentModel.TypeConverter(typeof(AvailableProviderOperationTypeConverter))] + public partial class AvailableProviderOperation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AvailableProviderOperation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AvailableProviderOperation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AvailableProviderOperation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AvailableProviderOperation(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Class represents provider operation + [System.ComponentModel.TypeConverter(typeof(AvailableProviderOperationTypeConverter))] + public partial interface IAvailableProviderOperation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperation.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperation.TypeConverter.cs new file mode 100644 index 000000000000..e28bb8db21f1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperation.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AvailableProviderOperationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AvailableProviderOperation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AvailableProviderOperation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AvailableProviderOperation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperation.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperation.cs new file mode 100644 index 000000000000..57267a95d7e4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperation.cs @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class represents provider operation + public partial class AvailableProviderOperation : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay _display; + + /// + /// Gets or sets Display information + /// Contains the localized display information for this particular operation/action + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperationDisplay()); set => this._display = value; } + + /// + /// Gets or sets Description + /// The localized friendly description for the operation, as it should be shown to the user. + /// It should be thorough, yet concise – it will be used in tool tips and detailed views. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)Display).Description = value ?? null; } + + /// + /// Gets or sets Operation + /// The localized friendly name for the operation, as it should be shown to the user. + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)Display).Operation = value ?? null; } + + /// + /// Gets or sets Provider + /// The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. + /// It should use Title Casing and begin with “Microsoft” for 1st party services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)Display).Provider = value ?? null; } + + /// + /// Gets or sets Resource + /// The localized friendly form of the resource type related to this action/operation – it should match the public documentation + /// for the resource provider. + /// It should use Title Casing – for examples, please refer to the “name” section. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)Display).Resource = value ?? null; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperationDisplay()); set { {_display = value;} } } + + /// Backing field for property. + private string _name; + + /// + /// Gets or sets the name of the operation being performed on this particular object + /// Return value format: "{resourceProviderNamespace}/{resourceType}/{read|write|deletion|action}" + /// Eg: Microsoft.StorSimple/managers/devices/fileServers/read + /// Microsoft.StorSimple/managers/devices/alerts/clearAlerts/action + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _origin; + + /// + /// Gets or sets Origin + /// The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. + /// Default value is “user,system” + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Origin { get => this._origin; set => this._origin = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny _property; + + /// + /// Gets or sets Properties + /// Reserved for future use + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Any()); set => this._property = value; } + + /// Creates an new instance. + public AvailableProviderOperation() + { + + } + } + /// Class represents provider operation + public partial interface IAvailableProviderOperation : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// + /// Gets or sets Description + /// The localized friendly description for the operation, as it should be shown to the user. + /// It should be thorough, yet concise – it will be used in tool tips and detailed views. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets Description + The localized friendly description for the operation, as it should be shown to the user. + It should be thorough, yet concise – it will be used in tool tips and detailed views.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; set; } + /// + /// Gets or sets Operation + /// The localized friendly name for the operation, as it should be shown to the user. + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets Operation + The localized friendly name for the operation, as it should be shown to the user. + 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.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string DisplayOperation { get; set; } + /// + /// Gets or sets Provider + /// The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. + /// It should use Title Casing and begin with “Microsoft” for 1st party services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets Provider + The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. + It should use Title Casing and begin with “Microsoft” for 1st party services.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string DisplayProvider { get; set; } + /// + /// Gets or sets Resource + /// The localized friendly form of the resource type related to this action/operation – it should match the public documentation + /// for the resource provider. + /// It should use Title Casing – for examples, please refer to the “name” section. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets Resource + The localized friendly form of the resource type related to this action/operation – it should match the public documentation for the resource provider. + It should use Title Casing – for examples, please refer to the “name” section.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; set; } + /// + /// Gets or sets the name of the operation being performed on this particular object + /// Return value format: "{resourceProviderNamespace}/{resourceType}/{read|write|deletion|action}" + /// Eg: Microsoft.StorSimple/managers/devices/fileServers/read + /// Microsoft.StorSimple/managers/devices/alerts/clearAlerts/action + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the name of the operation being performed on this particular object + Return value format: ""{resourceProviderNamespace}/{resourceType}/{read|write|deletion|action}"" + Eg: Microsoft.StorSimple/managers/devices/fileServers/read + Microsoft.StorSimple/managers/devices/alerts/clearAlerts/action", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// Gets or sets Origin + /// The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. + /// Default value is “user,system” + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets Origin + The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. + Default value is “user,system”", + SerializedName = @"origin", + PossibleTypes = new [] { typeof(string) })] + string Origin { get; set; } + /// + /// Gets or sets Properties + /// Reserved for future use + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets Properties + Reserved for future use", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny Property { get; set; } + + } + /// Class represents provider operation + internal partial interface IAvailableProviderOperationInternal + + { + /// + /// Gets or sets Display information + /// Contains the localized display information for this particular operation/action + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay Display { get; set; } + /// + /// Gets or sets Description + /// The localized friendly description for the operation, as it should be shown to the user. + /// It should be thorough, yet concise – it will be used in tool tips and detailed views. + /// + string DisplayDescription { get; set; } + /// + /// Gets or sets Operation + /// The localized friendly name for the operation, as it should be shown to the user. + /// 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. + /// + string DisplayOperation { get; set; } + /// + /// Gets or sets Provider + /// The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. + /// It should use Title Casing and begin with “Microsoft” for 1st party services. + /// + string DisplayProvider { get; set; } + /// + /// Gets or sets Resource + /// The localized friendly form of the resource type related to this action/operation – it should match the public documentation + /// for the resource provider. + /// It should use Title Casing – for examples, please refer to the “name” section. + /// + string DisplayResource { get; set; } + /// + /// Gets or sets the name of the operation being performed on this particular object + /// Return value format: "{resourceProviderNamespace}/{resourceType}/{read|write|deletion|action}" + /// Eg: Microsoft.StorSimple/managers/devices/fileServers/read + /// Microsoft.StorSimple/managers/devices/alerts/clearAlerts/action + /// + string Name { get; set; } + /// + /// Gets or sets Origin + /// The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. + /// Default value is “user,system” + /// + string Origin { get; set; } + /// + /// Gets or sets Properties + /// Reserved for future use + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IAny Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperation.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperation.json.cs new file mode 100644 index 000000000000..aebc7dc658b3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperation.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class represents provider operation + public partial class AvailableProviderOperation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AvailableProviderOperation(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperationDisplay.FromJson(__jsonDisplay) : Display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Any.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AvailableProviderOperation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperationDisplay.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperationDisplay.PowerShell.cs new file mode 100644 index 000000000000..84d365a38963 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperationDisplay.PowerShell.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// Contains the localized display information for this particular operation / action. + /// These value will be used by several clients for + /// (1) custom role definitions for RBAC; + /// (2) complex query filters for the event service; and (3) audit history / records for management operations. + /// + [System.ComponentModel.TypeConverter(typeof(AvailableProviderOperationDisplayTypeConverter))] + public partial class AvailableProviderOperationDisplay + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AvailableProviderOperationDisplay(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AvailableProviderOperationDisplay(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AvailableProviderOperationDisplay(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AvailableProviderOperationDisplay(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Contains the localized display information for this particular operation / action. + /// These value will be used by several clients for + /// (1) custom role definitions for RBAC; + /// (2) complex query filters for the event service; and (3) audit history / records for management operations. + [System.ComponentModel.TypeConverter(typeof(AvailableProviderOperationDisplayTypeConverter))] + public partial interface IAvailableProviderOperationDisplay + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperationDisplay.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperationDisplay.TypeConverter.cs new file mode 100644 index 000000000000..b231b5ace6b2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperationDisplay.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AvailableProviderOperationDisplayTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AvailableProviderOperationDisplay.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AvailableProviderOperationDisplay.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AvailableProviderOperationDisplay.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperationDisplay.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperationDisplay.cs new file mode 100644 index 000000000000..0318bee3c3bd --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperationDisplay.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// + /// Contains the localized display information for this particular operation / action. + /// These value will be used by several clients for + /// (1) custom role definitions for RBAC; + /// (2) complex query filters for the event service; and (3) audit history / records for management operations. + /// + public partial class AvailableProviderOperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplayInternal + { + + /// Backing field for property. + private string _description; + + /// + /// Gets or sets Description + /// The localized friendly description for the operation, as it should be shown to the user. + /// It should be thorough, yet concise – it will be used in tool tips and detailed views. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _operation; + + /// + /// Gets or sets Operation + /// The localized friendly name for the operation, as it should be shown to the user. + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Operation { get => this._operation; set => this._operation = value; } + + /// Backing field for property. + private string _provider; + + /// + /// Gets or sets Provider + /// The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. + /// It should use Title Casing and begin with “Microsoft” for 1st party services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Provider { get => this._provider; set => this._provider = value; } + + /// Backing field for property. + private string _resource; + + /// + /// Gets or sets Resource + /// The localized friendly form of the resource type related to this action/operation – it should match the public documentation + /// for the resource provider. + /// It should use Title Casing – for examples, please refer to the “name” section. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Resource { get => this._resource; set => this._resource = value; } + + /// Creates an new instance. + public AvailableProviderOperationDisplay() + { + + } + } + /// Contains the localized display information for this particular operation / action. + /// These value will be used by several clients for + /// (1) custom role definitions for RBAC; + /// (2) complex query filters for the event service; and (3) audit history / records for management operations. + public partial interface IAvailableProviderOperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// + /// Gets or sets Description + /// The localized friendly description for the operation, as it should be shown to the user. + /// It should be thorough, yet concise – it will be used in tool tips and detailed views. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets Description + The localized friendly description for the operation, as it should be shown to the user. + It should be thorough, yet concise – it will be used in tool tips and detailed views.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// + /// Gets or sets Operation + /// The localized friendly name for the operation, as it should be shown to the user. + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets Operation + The localized friendly name for the operation, as it should be shown to the user. + 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.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; set; } + /// + /// Gets or sets Provider + /// The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. + /// It should use Title Casing and begin with “Microsoft” for 1st party services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets Provider + The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. + It should use Title Casing and begin with “Microsoft” for 1st party services.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; set; } + /// + /// Gets or sets Resource + /// The localized friendly form of the resource type related to this action/operation – it should match the public documentation + /// for the resource provider. + /// It should use Title Casing – for examples, please refer to the “name” section. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets Resource + The localized friendly form of the resource type related to this action/operation – it should match the public documentation for the resource provider. + It should use Title Casing – for examples, please refer to the “name” section.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; set; } + + } + /// Contains the localized display information for this particular operation / action. + /// These value will be used by several clients for + /// (1) custom role definitions for RBAC; + /// (2) complex query filters for the event service; and (3) audit history / records for management operations. + internal partial interface IAvailableProviderOperationDisplayInternal + + { + /// + /// Gets or sets Description + /// The localized friendly description for the operation, as it should be shown to the user. + /// It should be thorough, yet concise – it will be used in tool tips and detailed views. + /// + string Description { get; set; } + /// + /// Gets or sets Operation + /// The localized friendly name for the operation, as it should be shown to the user. + /// 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. + /// + string Operation { get; set; } + /// + /// Gets or sets Provider + /// The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible. + /// It should use Title Casing and begin with “Microsoft” for 1st party services. + /// + string Provider { get; set; } + /// + /// Gets or sets Resource + /// The localized friendly form of the resource type related to this action/operation – it should match the public documentation + /// for the resource provider. + /// It should use Title Casing – for examples, please refer to the “name” section. + /// + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperationDisplay.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperationDisplay.json.cs new file mode 100644 index 000000000000..ce8f06e5befd --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperationDisplay.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// + /// Contains the localized display information for this particular operation / action. + /// These value will be used by several clients for + /// (1) custom role definitions for RBAC; + /// (2) complex query filters for the event service; and (3) audit history / records for management operations. + /// + public partial class AvailableProviderOperationDisplay + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AvailableProviderOperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AvailableProviderOperationDisplay(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperations.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperations.PowerShell.cs new file mode 100644 index 000000000000..207af25413c5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperations.PowerShell.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// Class for set of operations used for discovery of available provider operations. + /// + [System.ComponentModel.TypeConverter(typeof(AvailableProviderOperationsTypeConverter))] + public partial class AvailableProviderOperations + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AvailableProviderOperations(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationsInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AvailableProviderOperations(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationsInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperations DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AvailableProviderOperations(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperations DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AvailableProviderOperations(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperations FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Class for set of operations used for discovery of available provider operations. + [System.ComponentModel.TypeConverter(typeof(AvailableProviderOperationsTypeConverter))] + public partial interface IAvailableProviderOperations + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperations.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperations.TypeConverter.cs new file mode 100644 index 000000000000..119db9f3f330 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperations.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AvailableProviderOperationsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperations ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperations).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AvailableProviderOperations.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AvailableProviderOperations.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AvailableProviderOperations.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperations.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperations.cs new file mode 100644 index 000000000000..81e5a313ca0d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperations.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// + /// Class for set of operations used for discovery of available provider operations. + /// + public partial class AvailableProviderOperations : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperations, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperationsInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The NextLink. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public AvailableProviderOperations() + { + + } + } + /// Class for set of operations used for discovery of available provider operations. + public partial interface IAvailableProviderOperations : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The NextLink. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The NextLink.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation[] Value { get; set; } + + } + /// Class for set of operations used for discovery of available provider operations. + internal partial interface IAvailableProviderOperationsInternal + + { + /// The NextLink. + string NextLink { get; set; } + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperations.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperations.json.cs new file mode 100644 index 000000000000..1834dbe30e5d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/AvailableProviderOperations.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// + /// Class for set of operations used for discovery of available provider operations. + /// + public partial class AvailableProviderOperations + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal AvailableProviderOperations(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperation.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperations. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperations. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperations FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AvailableProviderOperations(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Backup.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Backup.PowerShell.cs new file mode 100644 index 000000000000..1ece6d7d7dbf --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Backup.PowerShell.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The backup. + [System.ComponentModel.TypeConverter(typeof(BackupTypeConverter))] + public partial class Backup + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Backup(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("InitiatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).InitiatedBy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy) content.GetValueForProperty("InitiatedBy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).InitiatedBy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy.CreateFrom); + } + if (content.Contains("TargetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).TargetId, global::System.Convert.ToString); + } + if (content.Contains("TargetType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).TargetType = (string) content.GetValueForProperty("TargetType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).TargetType, global::System.Convert.ToString); + } + if (content.Contains("SizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).SizeInByte = (long) content.GetValueForProperty("SizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).SizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CreatedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).ExpirationTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).ExpirationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).DeviceId = (string) content.GetValueForProperty("DeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).DeviceId, global::System.Convert.ToString); + } + if (content.Contains("Element")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).Element = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement[]) content.GetValueForProperty("Element",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).Element, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElementTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Backup(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("InitiatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).InitiatedBy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy) content.GetValueForProperty("InitiatedBy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).InitiatedBy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy.CreateFrom); + } + if (content.Contains("TargetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).TargetId, global::System.Convert.ToString); + } + if (content.Contains("TargetType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).TargetType = (string) content.GetValueForProperty("TargetType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).TargetType, global::System.Convert.ToString); + } + if (content.Contains("SizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).SizeInByte = (long) content.GetValueForProperty("SizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).SizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CreatedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).ExpirationTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).ExpirationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).DeviceId = (string) content.GetValueForProperty("DeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).DeviceId, global::System.Convert.ToString); + } + if (content.Contains("Element")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).Element = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement[]) content.GetValueForProperty("Element",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal)this).Element, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElementTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Backup(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Backup(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The backup. + [System.ComponentModel.TypeConverter(typeof(BackupTypeConverter))] + public partial interface IBackup + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Backup.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Backup.TypeConverter.cs new file mode 100644 index 000000000000..3f3de0c58c1a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Backup.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Backup.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Backup.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Backup.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Backup.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Backup.cs new file mode 100644 index 000000000000..08353d828c31 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Backup.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The backup. + public partial class Backup : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The time when the backup was created. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime? CreatedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).CreatedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).CreatedTime = value ?? default(global::System.DateTime); } + + /// The Device Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DeviceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).DeviceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).DeviceId = value ; } + + /// The backup elements. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement[] Element { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).Element; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).Element = value ; } + + /// The time when the backup will expire. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime? ExpirationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).ExpirationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).ExpirationTime = value ?? default(global::System.DateTime); } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Indicates how the backup was initiated "Manual | Scheduled". + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy InitiatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).InitiatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).InitiatedBy = value ; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupProperties()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties _property; + + /// Properties of backup + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupProperties()); set => this._property = value; } + + /// The backup size in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long SizeInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).SizeInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).SizeInByte = value ; } + + /// + /// The path id of the target FileServer or IscsiServer for which the backup was taken. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string TargetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).TargetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).TargetId = value ?? null; } + + /// Type of target, FileServer or IscsiServer + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string TargetType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).TargetType; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)Property).TargetType = value ?? null; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public Backup() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The backup. + public partial interface IBackup : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// The time when the backup was created. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the backup was created.", + SerializedName = @"createdTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedTime { get; set; } + /// The Device Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Device Identifier.", + SerializedName = @"deviceId", + PossibleTypes = new [] { typeof(string) })] + string DeviceId { get; set; } + /// The backup elements. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup elements.", + SerializedName = @"elements", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement[] Element { get; set; } + /// The time when the backup will expire. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the backup will expire.", + SerializedName = @"expirationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTime { get; set; } + /// Indicates how the backup was initiated "Manual | Scheduled". + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Indicates how the backup was initiated ""Manual | Scheduled"".", + SerializedName = @"initiatedBy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy InitiatedBy { get; set; } + /// The backup size in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup size in bytes.", + SerializedName = @"sizeInBytes", + PossibleTypes = new [] { typeof(long) })] + long SizeInByte { get; set; } + /// + /// The path id of the target FileServer or IscsiServer for which the backup was taken. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path id of the target FileServer or IscsiServer for which the backup was taken.", + SerializedName = @"targetId", + PossibleTypes = new [] { typeof(string) })] + string TargetId { get; set; } + /// Type of target, FileServer or IscsiServer + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of target, FileServer or IscsiServer", + SerializedName = @"targetType", + PossibleTypes = new [] { typeof(string) })] + string TargetType { get; set; } + + } + /// The backup. + internal partial interface IBackupInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The time when the backup was created. + global::System.DateTime? CreatedTime { get; set; } + /// The Device Identifier. + string DeviceId { get; set; } + /// The backup elements. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement[] Element { get; set; } + /// The time when the backup will expire. + global::System.DateTime? ExpirationTime { get; set; } + /// Indicates how the backup was initiated "Manual | Scheduled". + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy InitiatedBy { get; set; } + /// Properties of backup + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties Property { get; set; } + /// The backup size in bytes. + long SizeInByte { get; set; } + /// + /// The path id of the target FileServer or IscsiServer for which the backup was taken. + /// + string TargetId { get; set; } + /// Type of target, FileServer or IscsiServer + string TargetType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Backup.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Backup.json.cs new file mode 100644 index 000000000000..1dec07a146c1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Backup.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The backup. + public partial class Backup + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal Backup(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new Backup(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElement.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElement.PowerShell.cs new file mode 100644 index 000000000000..26f8bf67ffc0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElement.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Class represents BackupElement + [System.ComponentModel.TypeConverter(typeof(BackupElementTypeConverter))] + public partial class BackupElement + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupElement(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElementPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("SizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).SizeInByte = (long) content.GetValueForProperty("SizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).SizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EndpointName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).EndpointName = (string) content.GetValueForProperty("EndpointName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).EndpointName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupElement(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElementPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("SizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).SizeInByte = (long) content.GetValueForProperty("SizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).SizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EndpointName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).EndpointName = (string) content.GetValueForProperty("EndpointName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal)this).EndpointName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupElement(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupElement(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Class represents BackupElement + [System.ComponentModel.TypeConverter(typeof(BackupElementTypeConverter))] + public partial interface IBackupElement + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElement.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElement.TypeConverter.cs new file mode 100644 index 000000000000..eca3afa3957e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElement.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupElementTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupElement.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupElement.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupElement.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElement.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElement.cs new file mode 100644 index 000000000000..737f03a4a687 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElement.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class represents BackupElement + public partial class BackupElement : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The data policy of backed up endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)Property).DataPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)Property).DataPolicy = value ; } + + /// The name of the endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string EndpointName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)Property).EndpointName; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)Property).EndpointName = value ; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElementProperties()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties _property; + + /// The Properties of backup element + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElementProperties()); set => this._property = value; } + + /// The size in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long SizeInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)Property).SizeInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)Property).SizeInByte = value ; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public BackupElement() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// Class represents BackupElement + public partial interface IBackupElement : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// The data policy of backed up endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The data policy of backed up endpoint.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get; set; } + /// The name of the endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the endpoint.", + SerializedName = @"endpointName", + PossibleTypes = new [] { typeof(string) })] + string EndpointName { get; set; } + /// The size in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The size in bytes.", + SerializedName = @"sizeInBytes", + PossibleTypes = new [] { typeof(long) })] + long SizeInByte { get; set; } + + } + /// Class represents BackupElement + internal partial interface IBackupElementInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The data policy of backed up endpoint. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get; set; } + /// The name of the endpoint. + string EndpointName { get; set; } + /// The Properties of backup element + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties Property { get; set; } + /// The size in bytes. + long SizeInByte { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElement.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElement.json.cs new file mode 100644 index 000000000000..13a2a1078b20 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElement.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class represents BackupElement + public partial class BackupElement + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal BackupElement(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElementProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new BackupElement(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElementProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElementProperties.PowerShell.cs new file mode 100644 index 000000000000..4fc6c090003c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElementProperties.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The backup element properties + [System.ComponentModel.TypeConverter(typeof(BackupElementPropertiesTypeConverter))] + public partial class BackupElementProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupElementProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)this).SizeInByte = (long) content.GetValueForProperty("SizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)this).SizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EndpointName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)this).EndpointName = (string) content.GetValueForProperty("EndpointName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)this).EndpointName, global::System.Convert.ToString); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupElementProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)this).SizeInByte = (long) content.GetValueForProperty("SizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)this).SizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EndpointName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)this).EndpointName = (string) content.GetValueForProperty("EndpointName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)this).EndpointName, global::System.Convert.ToString); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupElementProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupElementProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The backup element properties + [System.ComponentModel.TypeConverter(typeof(BackupElementPropertiesTypeConverter))] + public partial interface IBackupElementProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElementProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElementProperties.TypeConverter.cs new file mode 100644 index 000000000000..5f747253e396 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElementProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupElementPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupElementProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupElementProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupElementProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElementProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElementProperties.cs new file mode 100644 index 000000000000..7049bd3978e1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElementProperties.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The backup element properties + public partial class BackupElementProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy _dataPolicy; + + /// The data policy of backed up endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get => this._dataPolicy; set => this._dataPolicy = value; } + + /// Backing field for property. + private string _endpointName; + + /// The name of the endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string EndpointName { get => this._endpointName; set => this._endpointName = value; } + + /// Backing field for property. + private long _sizeInByte; + + /// The size in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long SizeInByte { get => this._sizeInByte; set => this._sizeInByte = value; } + + /// Creates an new instance. + public BackupElementProperties() + { + + } + } + /// The backup element properties + public partial interface IBackupElementProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The data policy of backed up endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The data policy of backed up endpoint.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get; set; } + /// The name of the endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the endpoint.", + SerializedName = @"endpointName", + PossibleTypes = new [] { typeof(string) })] + string EndpointName { get; set; } + /// The size in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The size in bytes.", + SerializedName = @"sizeInBytes", + PossibleTypes = new [] { typeof(long) })] + long SizeInByte { get; set; } + + } + /// The backup element properties + internal partial interface IBackupElementPropertiesInternal + + { + /// The data policy of backed up endpoint. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get; set; } + /// The name of the endpoint. + string EndpointName { get; set; } + /// The size in bytes. + long SizeInByte { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElementProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElementProperties.json.cs new file mode 100644 index 000000000000..9481be316538 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupElementProperties.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The backup element properties + public partial class BackupElementProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal BackupElementProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sizeInByte = If( json?.PropertyT("sizeInBytes"), out var __jsonSizeInBytes) ? (long)__jsonSizeInBytes : SizeInByte;} + {_endpointName = If( json?.PropertyT("endpointName"), out var __jsonEndpointName) ? (string)__jsonEndpointName : (string)EndpointName;} + {_dataPolicy = If( json?.PropertyT("dataPolicy"), out var __jsonDataPolicy) ? (string)__jsonDataPolicy : (string)DataPolicy;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElementProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new BackupElementProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber(this._sizeInByte), "sizeInBytes" ,container.Add ); + AddIf( null != (((object)this._endpointName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._endpointName.ToString()) : null, "endpointName" ,container.Add ); + AddIf( null != (((object)this._dataPolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._dataPolicy.ToString()) : null, "dataPolicy" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupFilter.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupFilter.PowerShell.cs new file mode 100644 index 000000000000..f9092524d326 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupFilter.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Backup OData filter class + [System.ComponentModel.TypeConverter(typeof(BackupFilterTypeConverter))] + public partial class BackupFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InitiatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilterInternal)this).InitiatedBy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy?) content.GetValueForProperty("InitiatedBy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilterInternal)this).InitiatedBy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy.CreateFrom); + } + if (content.Contains("CreatedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilterInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilterInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InitiatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilterInternal)this).InitiatedBy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy?) content.GetValueForProperty("InitiatedBy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilterInternal)this).InitiatedBy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy.CreateFrom); + } + if (content.Contains("CreatedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilterInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilterInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Backup OData filter class + [System.ComponentModel.TypeConverter(typeof(BackupFilterTypeConverter))] + public partial interface IBackupFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupFilter.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupFilter.TypeConverter.cs new file mode 100644 index 000000000000..dee17effe419 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupFilter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupFilter.cs new file mode 100644 index 000000000000..d08630f559f1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupFilter.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Backup OData filter class + public partial class BackupFilter : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilter, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilterInternal + { + + /// Backing field for property. + private global::System.DateTime? _createdTime; + + /// Gets or sets CreatedTime + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedTime { get => this._createdTime; set => this._createdTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy? _initiatedBy; + + /// Gets or sets InitiatedBy + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy? InitiatedBy { get => this._initiatedBy; set => this._initiatedBy = value; } + + /// Creates an new instance. + public BackupFilter() + { + + } + } + /// Backup OData filter class + public partial interface IBackupFilter : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Gets or sets CreatedTime + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets CreatedTime", + SerializedName = @"createdTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedTime { get; set; } + /// Gets or sets InitiatedBy + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets InitiatedBy", + SerializedName = @"initiatedBy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy? InitiatedBy { get; set; } + + } + /// Backup OData filter class + internal partial interface IBackupFilterInternal + + { + /// Gets or sets CreatedTime + global::System.DateTime? CreatedTime { get; set; } + /// Gets or sets InitiatedBy + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy? InitiatedBy { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupFilter.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupFilter.json.cs new file mode 100644 index 000000000000..cbc930ad11a1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupFilter.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Backup OData filter class + public partial class BackupFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal BackupFilter(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_initiatedBy = If( json?.PropertyT("initiatedBy"), out var __jsonInitiatedBy) ? (string)__jsonInitiatedBy : (string)InitiatedBy;} + {_createdTime = If( json?.PropertyT("createdTime"), out var __jsonCreatedTime) ? global::System.DateTime.TryParse((string)__jsonCreatedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedTimeValue) ? __jsonCreatedTimeValue : CreatedTime : CreatedTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new BackupFilter(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._initiatedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._initiatedBy.ToString()) : null, "initiatedBy" ,container.Add ); + AddIf( null != this._createdTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._createdTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupList.PowerShell.cs new file mode 100644 index 000000000000..0fd9f242eebe --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupList.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Collection of backups + [System.ComponentModel.TypeConverter(typeof(BackupListTypeConverter))] + public partial class BackupList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of backups + [System.ComponentModel.TypeConverter(typeof(BackupListTypeConverter))] + public partial interface IBackupList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupList.TypeConverter.cs new file mode 100644 index 000000000000..cf9abd7bad70 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupList.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupList.cs new file mode 100644 index 000000000000..f47f1cc93575 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupList.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of backups + public partial class BackupList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The NextLink. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public BackupList() + { + + } + } + /// Collection of backups + public partial interface IBackupList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The NextLink. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The NextLink.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup[] Value { get; set; } + + } + /// Collection of backups + internal partial interface IBackupListInternal + + { + /// The NextLink. + string NextLink { get; set; } + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupList.json.cs new file mode 100644 index 000000000000..1cfec9f5f5a6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupList.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of backups + public partial class BackupList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal BackupList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Backup.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new BackupList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupProperties.PowerShell.cs new file mode 100644 index 000000000000..0ba27902f485 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupProperties.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Class represents Backup properties + [System.ComponentModel.TypeConverter(typeof(BackupPropertiesTypeConverter))] + public partial class BackupProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).TargetId, global::System.Convert.ToString); + } + if (content.Contains("TargetType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).TargetType = (string) content.GetValueForProperty("TargetType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).TargetType, global::System.Convert.ToString); + } + if (content.Contains("SizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).SizeInByte = (long) content.GetValueForProperty("SizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).SizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CreatedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).ExpirationTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).ExpirationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InitiatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).InitiatedBy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy) content.GetValueForProperty("InitiatedBy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).InitiatedBy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy.CreateFrom); + } + if (content.Contains("DeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).DeviceId = (string) content.GetValueForProperty("DeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).DeviceId, global::System.Convert.ToString); + } + if (content.Contains("Element")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).Element = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement[]) content.GetValueForProperty("Element",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).Element, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElementTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TargetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).TargetId, global::System.Convert.ToString); + } + if (content.Contains("TargetType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).TargetType = (string) content.GetValueForProperty("TargetType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).TargetType, global::System.Convert.ToString); + } + if (content.Contains("SizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).SizeInByte = (long) content.GetValueForProperty("SizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).SizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CreatedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).CreatedTime = (global::System.DateTime?) content.GetValueForProperty("CreatedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).CreatedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).ExpirationTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).ExpirationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InitiatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).InitiatedBy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy) content.GetValueForProperty("InitiatedBy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).InitiatedBy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy.CreateFrom); + } + if (content.Contains("DeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).DeviceId = (string) content.GetValueForProperty("DeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).DeviceId, global::System.Convert.ToString); + } + if (content.Contains("Element")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).Element = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement[]) content.GetValueForProperty("Element",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal)this).Element, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElementTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Class represents Backup properties + [System.ComponentModel.TypeConverter(typeof(BackupPropertiesTypeConverter))] + public partial interface IBackupProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupProperties.TypeConverter.cs new file mode 100644 index 000000000000..318b746acb1c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupProperties.cs new file mode 100644 index 000000000000..2b62c5722ae4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupProperties.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class represents Backup properties + public partial class BackupProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupPropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime? _createdTime; + + /// The time when the backup was created. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedTime { get => this._createdTime; set => this._createdTime = value; } + + /// Backing field for property. + private string _deviceId; + + /// The Device Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string DeviceId { get => this._deviceId; set => this._deviceId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement[] _element; + + /// The backup elements. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement[] Element { get => this._element; set => this._element = value; } + + /// Backing field for property. + private global::System.DateTime? _expirationTime; + + /// The time when the backup will expire. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? ExpirationTime { get => this._expirationTime; set => this._expirationTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy _initiatedBy; + + /// Indicates how the backup was initiated "Manual | Scheduled". + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy InitiatedBy { get => this._initiatedBy; set => this._initiatedBy = value; } + + /// Backing field for property. + private long _sizeInByte; + + /// The backup size in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long SizeInByte { get => this._sizeInByte; set => this._sizeInByte = value; } + + /// Backing field for property. + private string _targetId; + + /// + /// The path id of the target FileServer or IscsiServer for which the backup was taken. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string TargetId { get => this._targetId; set => this._targetId = value; } + + /// Backing field for property. + private string _targetType; + + /// Type of target, FileServer or IscsiServer + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string TargetType { get => this._targetType; set => this._targetType = value; } + + /// Creates an new instance. + public BackupProperties() + { + + } + } + /// Class represents Backup properties + public partial interface IBackupProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The time when the backup was created. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the backup was created.", + SerializedName = @"createdTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedTime { get; set; } + /// The Device Identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Device Identifier.", + SerializedName = @"deviceId", + PossibleTypes = new [] { typeof(string) })] + string DeviceId { get; set; } + /// The backup elements. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup elements.", + SerializedName = @"elements", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement[] Element { get; set; } + /// The time when the backup will expire. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the backup will expire.", + SerializedName = @"expirationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpirationTime { get; set; } + /// Indicates how the backup was initiated "Manual | Scheduled". + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Indicates how the backup was initiated ""Manual | Scheduled"".", + SerializedName = @"initiatedBy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy InitiatedBy { get; set; } + /// The backup size in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup size in bytes.", + SerializedName = @"sizeInBytes", + PossibleTypes = new [] { typeof(long) })] + long SizeInByte { get; set; } + /// + /// The path id of the target FileServer or IscsiServer for which the backup was taken. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The path id of the target FileServer or IscsiServer for which the backup was taken.", + SerializedName = @"targetId", + PossibleTypes = new [] { typeof(string) })] + string TargetId { get; set; } + /// Type of target, FileServer or IscsiServer + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of target, FileServer or IscsiServer", + SerializedName = @"targetType", + PossibleTypes = new [] { typeof(string) })] + string TargetType { get; set; } + + } + /// Class represents Backup properties + internal partial interface IBackupPropertiesInternal + + { + /// The time when the backup was created. + global::System.DateTime? CreatedTime { get; set; } + /// The Device Identifier. + string DeviceId { get; set; } + /// The backup elements. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement[] Element { get; set; } + /// The time when the backup will expire. + global::System.DateTime? ExpirationTime { get; set; } + /// Indicates how the backup was initiated "Manual | Scheduled". + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy InitiatedBy { get; set; } + /// The backup size in bytes. + long SizeInByte { get; set; } + /// + /// The path id of the target FileServer or IscsiServer for which the backup was taken. + /// + string TargetId { get; set; } + /// Type of target, FileServer or IscsiServer + string TargetType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupProperties.json.cs new file mode 100644 index 000000000000..0e857dbe8f17 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupProperties.json.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class represents Backup properties + public partial class BackupProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal BackupProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_targetId = If( json?.PropertyT("targetId"), out var __jsonTargetId) ? (string)__jsonTargetId : (string)TargetId;} + {_targetType = If( json?.PropertyT("targetType"), out var __jsonTargetType) ? (string)__jsonTargetType : (string)TargetType;} + {_sizeInByte = If( json?.PropertyT("sizeInBytes"), out var __jsonSizeInBytes) ? (long)__jsonSizeInBytes : SizeInByte;} + {_createdTime = If( json?.PropertyT("createdTime"), out var __jsonCreatedTime) ? global::System.DateTime.TryParse((string)__jsonCreatedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedTimeValue) ? __jsonCreatedTimeValue : CreatedTime : CreatedTime;} + {_expirationTime = If( json?.PropertyT("expirationTime"), out var __jsonExpirationTime) ? global::System.DateTime.TryParse((string)__jsonExpirationTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationTimeValue) ? __jsonExpirationTimeValue : ExpirationTime : ExpirationTime;} + {_initiatedBy = If( json?.PropertyT("initiatedBy"), out var __jsonInitiatedBy) ? (string)__jsonInitiatedBy : (string)InitiatedBy;} + {_deviceId = If( json?.PropertyT("deviceId"), out var __jsonDeviceId) ? (string)__jsonDeviceId : (string)DeviceId;} + {_element = If( json?.PropertyT("elements"), out var __jsonElements) ? If( __jsonElements as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupElement) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupElement.FromJson(__u) )) ))() : null : Element;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new BackupProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._targetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._targetId.ToString()) : null, "targetId" ,container.Add ); + AddIf( null != (((object)this._targetType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._targetType.ToString()) : null, "targetType" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber(this._sizeInByte), "sizeInBytes" ,container.Add ); + AddIf( null != this._createdTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._createdTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdTime" ,container.Add ); + AddIf( null != this._expirationTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._expirationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expirationTime" ,container.Add ); + AddIf( null != (((object)this._initiatedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._initiatedBy.ToString()) : null, "initiatedBy" ,container.Add ); + AddIf( null != (((object)this._deviceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._deviceId.ToString()) : null, "deviceId" ,container.Add ); + if (null != this._element) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._element ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("elements",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroup.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroup.PowerShell.cs new file mode 100644 index 000000000000..af15d9c148e9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroup.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The Backup Schedule Group + [System.ComponentModel.TypeConverter(typeof(BackupScheduleGroupTypeConverter))] + public partial class BackupScheduleGroup + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupScheduleGroup(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroupPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).StartTime = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).StartTime, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeTypeConverter.ConvertFrom); + } + if (content.Contains("StartTimeHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).StartTimeHour = (int) content.GetValueForProperty("StartTimeHour",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).StartTimeHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StartTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).StartTimeMinute = (int) content.GetValueForProperty("StartTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).StartTimeMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupScheduleGroup(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroupPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).StartTime = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).StartTime, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeTypeConverter.ConvertFrom); + } + if (content.Contains("StartTimeHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).StartTimeHour = (int) content.GetValueForProperty("StartTimeHour",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).StartTimeHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StartTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).StartTimeMinute = (int) content.GetValueForProperty("StartTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal)this).StartTimeMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupScheduleGroup(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupScheduleGroup(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Backup Schedule Group + [System.ComponentModel.TypeConverter(typeof(BackupScheduleGroupTypeConverter))] + public partial interface IBackupScheduleGroup + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroup.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroup.TypeConverter.cs new file mode 100644 index 000000000000..84daab518d9d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroup.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupScheduleGroupTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupScheduleGroup.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupScheduleGroup.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupScheduleGroup.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroup.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroup.cs new file mode 100644 index 000000000000..1d87ccf82d8b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroup.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Backup Schedule Group + public partial class BackupScheduleGroup : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroupProperties()); set { {_property = value;} } } + + /// Internal Acessors for StartTime + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupInternal.StartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)Property).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)Property).StartTime = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties _property; + + /// Properties of BackupScheduleGroup + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroupProperties()); set => this._property = value; } + + /// The hour. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int StartTimeHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)Property).StartTimeHour; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)Property).StartTimeHour = value ; } + + /// The minute. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int StartTimeMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)Property).StartTimeMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)Property).StartTimeMinute = value ; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public BackupScheduleGroup() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The Backup Schedule Group + public partial interface IBackupScheduleGroup : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// The hour. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The hour.", + SerializedName = @"hour", + PossibleTypes = new [] { typeof(int) })] + int StartTimeHour { get; set; } + /// The minute. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The minute.", + SerializedName = @"minute", + PossibleTypes = new [] { typeof(int) })] + int StartTimeMinute { get; set; } + + } + /// The Backup Schedule Group + internal partial interface IBackupScheduleGroupInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// Properties of BackupScheduleGroup + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties Property { get; set; } + /// + /// The start time. When this field is specified we will generate Default GrandFather Father Son Backup Schedules. + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime StartTime { get; set; } + /// The hour. + int StartTimeHour { get; set; } + /// The minute. + int StartTimeMinute { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroup.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroup.json.cs new file mode 100644 index 000000000000..feead6006a0d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroup.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Backup Schedule Group + public partial class BackupScheduleGroup + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal BackupScheduleGroup(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroupProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new BackupScheduleGroup(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupList.PowerShell.cs new file mode 100644 index 000000000000..455b337b50db --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupList.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The list response of backup schedule groups + [System.ComponentModel.TypeConverter(typeof(BackupScheduleGroupListTypeConverter))] + public partial class BackupScheduleGroupList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupScheduleGroupList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroupTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupScheduleGroupList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroupTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupScheduleGroupList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupScheduleGroupList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The list response of backup schedule groups + [System.ComponentModel.TypeConverter(typeof(BackupScheduleGroupListTypeConverter))] + public partial interface IBackupScheduleGroupList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupList.TypeConverter.cs new file mode 100644 index 000000000000..c725258314f0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupScheduleGroupListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupScheduleGroupList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupScheduleGroupList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupScheduleGroupList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupList.cs new file mode 100644 index 000000000000..c8630f4a0444 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The list response of backup schedule groups + public partial class BackupScheduleGroupList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public BackupScheduleGroupList() + { + + } + } + /// The list response of backup schedule groups + public partial interface IBackupScheduleGroupList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup[] Value { get; set; } + + } + /// The list response of backup schedule groups + internal partial interface IBackupScheduleGroupListInternal + + { + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupList.json.cs new file mode 100644 index 000000000000..b15760386fa5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The list response of backup schedule groups + public partial class BackupScheduleGroupList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal BackupScheduleGroupList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroup.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new BackupScheduleGroupList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupProperties.PowerShell.cs new file mode 100644 index 000000000000..3fee484b833d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupProperties.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The Backup Schedule Group Properties + [System.ComponentModel.TypeConverter(typeof(BackupScheduleGroupPropertiesTypeConverter))] + public partial class BackupScheduleGroupProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BackupScheduleGroupProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)this).StartTime = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)this).StartTime, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeTypeConverter.ConvertFrom); + } + if (content.Contains("StartTimeHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)this).StartTimeHour = (int) content.GetValueForProperty("StartTimeHour",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)this).StartTimeHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StartTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)this).StartTimeMinute = (int) content.GetValueForProperty("StartTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)this).StartTimeMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BackupScheduleGroupProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)this).StartTime = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)this).StartTime, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeTypeConverter.ConvertFrom); + } + if (content.Contains("StartTimeHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)this).StartTimeHour = (int) content.GetValueForProperty("StartTimeHour",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)this).StartTimeHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StartTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)this).StartTimeMinute = (int) content.GetValueForProperty("StartTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal)this).StartTimeMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BackupScheduleGroupProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BackupScheduleGroupProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Backup Schedule Group Properties + [System.ComponentModel.TypeConverter(typeof(BackupScheduleGroupPropertiesTypeConverter))] + public partial interface IBackupScheduleGroupProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupProperties.TypeConverter.cs new file mode 100644 index 000000000000..a37355b502df --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BackupScheduleGroupPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BackupScheduleGroupProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BackupScheduleGroupProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BackupScheduleGroupProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupProperties.cs new file mode 100644 index 000000000000..3299493331a4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupProperties.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Backup Schedule Group Properties + public partial class BackupScheduleGroupProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal + { + + /// Internal Acessors for StartTime + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupPropertiesInternal.StartTime { get => (this._startTime = this._startTime ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Time()); set { {_startTime = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime _startTime; + + /// + /// The start time. When this field is specified we will generate Default GrandFather Father Son Backup Schedules. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime StartTime { get => (this._startTime = this._startTime ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Time()); set => this._startTime = value; } + + /// The hour. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int StartTimeHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeInternal)StartTime).Hour; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeInternal)StartTime).Hour = value ; } + + /// The minute. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int StartTimeMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeInternal)StartTime).Minute; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeInternal)StartTime).Minute = value ; } + + /// Creates an new instance. + public BackupScheduleGroupProperties() + { + + } + } + /// The Backup Schedule Group Properties + public partial interface IBackupScheduleGroupProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The hour. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The hour.", + SerializedName = @"hour", + PossibleTypes = new [] { typeof(int) })] + int StartTimeHour { get; set; } + /// The minute. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The minute.", + SerializedName = @"minute", + PossibleTypes = new [] { typeof(int) })] + int StartTimeMinute { get; set; } + + } + /// The Backup Schedule Group Properties + internal partial interface IBackupScheduleGroupPropertiesInternal + + { + /// + /// The start time. When this field is specified we will generate Default GrandFather Father Son Backup Schedules. + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime StartTime { get; set; } + /// The hour. + int StartTimeHour { get; set; } + /// The minute. + int StartTimeMinute { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupProperties.json.cs new file mode 100644 index 000000000000..fdbb91f5b650 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BackupScheduleGroupProperties.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Backup Schedule Group Properties + public partial class BackupScheduleGroupProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal BackupScheduleGroupProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Time.FromJson(__jsonStartTime) : StartTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new BackupScheduleGroupProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._startTime.ToJson(null,serializationMode) : null, "startTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BaseModel.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BaseModel.PowerShell.cs new file mode 100644 index 000000000000..0ab9e3726b1d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BaseModel.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Base class for models + [System.ComponentModel.TypeConverter(typeof(BaseModelTypeConverter))] + public partial class BaseModel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BaseModel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BaseModel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BaseModel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BaseModel(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Base class for models + [System.ComponentModel.TypeConverter(typeof(BaseModelTypeConverter))] + public partial interface IBaseModel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BaseModel.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BaseModel.TypeConverter.cs new file mode 100644 index 000000000000..746e71db84cc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BaseModel.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BaseModelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BaseModel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BaseModel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BaseModel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BaseModel.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BaseModel.cs new file mode 100644 index 000000000000..be820a6507f8 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BaseModel.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Base class for models + public partial class BaseModel : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + + /// Backing field for property. + private string _id; + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _type; + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public BaseModel() + { + + } + } + /// Base class for models + public partial interface IBaseModel : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The identifier.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// Base class for models + internal partial interface IBaseModelInternal + + { + /// The identifier. + string Id { get; set; } + /// The name. + string Name { get; set; } + /// The type. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BaseModel.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BaseModel.json.cs new file mode 100644 index 000000000000..a96b6922700f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/BaseModel.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Base class for models + public partial class BaseModel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal BaseModel(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new BaseModel(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapProperties.PowerShell.cs new file mode 100644 index 000000000000..e808530292de --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapProperties.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Chap properties + [System.ComponentModel.TypeConverter(typeof(ChapPropertiesTypeConverter))] + public partial class ChapProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ChapProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).Password = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).Password, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("PasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).PasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("PasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).PasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("PasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).PasswordValue = (string) content.GetValueForProperty("PasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).PasswordValue, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).PasswordEncryptionCertificateThumbprint = (string) content.GetValueForProperty("PasswordEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).PasswordEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ChapProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).Password = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).Password, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("PasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).PasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("PasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).PasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("PasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).PasswordValue = (string) content.GetValueForProperty("PasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).PasswordValue, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).PasswordEncryptionCertificateThumbprint = (string) content.GetValueForProperty("PasswordEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)this).PasswordEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ChapProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ChapProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Chap properties + [System.ComponentModel.TypeConverter(typeof(ChapPropertiesTypeConverter))] + public partial interface IChapProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapProperties.TypeConverter.cs new file mode 100644 index 000000000000..8f6ba6abde5e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ChapPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ChapProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ChapProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ChapProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapProperties.cs new file mode 100644 index 000000000000..0546c0edc376 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapProperties.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Chap properties + public partial class ChapProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal + { + + /// Internal Acessors for Password + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal.Password { get => (this._password = this._password ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret()); set { {_password = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret _password; + + /// The chap password. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret Password { get => (this._password = this._password ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret()); set => this._password = value; } + + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm PasswordEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)Password).EncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)Password).EncryptionAlgorithm = value ; } + + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string PasswordEncryptionCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)Password).EncryptionCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)Password).EncryptionCertificateThumbprint = value ?? null; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string PasswordValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)Password).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)Password).Value = value ; } + + /// Creates an new instance. + public ChapProperties() + { + + } + } + /// Chap properties + public partial interface IChapProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm PasswordEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + string PasswordEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string PasswordValue { get; set; } + + } + /// Chap properties + internal partial interface IChapPropertiesInternal + + { + /// The chap password. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret Password { get; set; } + /// Algorithm used to encrypt "Value" + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm PasswordEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + string PasswordEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + string PasswordValue { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapProperties.json.cs new file mode 100644 index 000000000000..803106d573e4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapProperties.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Chap properties + public partial class ChapProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal ChapProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret.FromJson(__jsonPassword) : Password;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ChapProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._password ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._password.ToJson(null,serializationMode) : null, "password" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettings.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettings.PowerShell.cs new file mode 100644 index 000000000000..8210a720e5a2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettings.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Challenge-Handshake Authentication Protocol (CHAP) setting + [System.ComponentModel.TypeConverter(typeof(ChapSettingsTypeConverter))] + public partial class ChapSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ChapSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).Password = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).Password, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("PasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).PasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("PasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).PasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("PasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).PasswordValue = (string) content.GetValueForProperty("PasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).PasswordValue, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).PasswordEncryptionCertificateThumbprint = (string) content.GetValueForProperty("PasswordEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).PasswordEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ChapSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).Password = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).Password, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("PasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).PasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("PasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).PasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("PasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).PasswordValue = (string) content.GetValueForProperty("PasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).PasswordValue, global::System.Convert.ToString); + } + if (content.Contains("PasswordEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).PasswordEncryptionCertificateThumbprint = (string) content.GetValueForProperty("PasswordEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal)this).PasswordEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ChapSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ChapSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Challenge-Handshake Authentication Protocol (CHAP) setting + [System.ComponentModel.TypeConverter(typeof(ChapSettingsTypeConverter))] + public partial interface IChapSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettings.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettings.TypeConverter.cs new file mode 100644 index 000000000000..0645853cfc78 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettings.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ChapSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ChapSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ChapSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ChapSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettings.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettings.cs new file mode 100644 index 000000000000..18411e05caec --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettings.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Challenge-Handshake Authentication Protocol (CHAP) setting + public partial class ChapSettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for Password + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal.Password { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)Property).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)Property).Password = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapProperties()); set { {_property = value;} } } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm PasswordEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)Property).PasswordEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)Property).PasswordEncryptionAlgorithm = value ; } + + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string PasswordEncryptionCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)Property).PasswordEncryptionCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)Property).PasswordEncryptionCertificateThumbprint = value ?? null; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string PasswordValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)Property).PasswordValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapPropertiesInternal)Property).PasswordValue = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties _property; + + /// Chap properties + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapProperties()); set => this._property = value; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public ChapSettings() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// Challenge-Handshake Authentication Protocol (CHAP) setting + public partial interface IChapSettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm PasswordEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + string PasswordEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string PasswordValue { get; set; } + + } + /// Challenge-Handshake Authentication Protocol (CHAP) setting + internal partial interface IChapSettingsInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The chap password. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret Password { get; set; } + /// Algorithm used to encrypt "Value" + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm PasswordEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + string PasswordEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + string PasswordValue { get; set; } + /// Chap properties + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettings.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettings.json.cs new file mode 100644 index 000000000000..d5128fa2a654 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettings.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Challenge-Handshake Authentication Protocol (CHAP) setting + public partial class ChapSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal ChapSettings(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ChapSettings(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettingsList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettingsList.PowerShell.cs new file mode 100644 index 000000000000..9e914ca65137 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettingsList.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Collection of Chap setting entities + [System.ComponentModel.TypeConverter(typeof(ChapSettingsListTypeConverter))] + public partial class ChapSettingsList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ChapSettingsList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapSettingsTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ChapSettingsList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapSettingsTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ChapSettingsList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ChapSettingsList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of Chap setting entities + [System.ComponentModel.TypeConverter(typeof(ChapSettingsListTypeConverter))] + public partial interface IChapSettingsList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettingsList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettingsList.TypeConverter.cs new file mode 100644 index 000000000000..db04c6373632 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettingsList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ChapSettingsListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ChapSettingsList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ChapSettingsList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ChapSettingsList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettingsList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettingsList.cs new file mode 100644 index 000000000000..aa85406e4af9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettingsList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of Chap setting entities + public partial class ChapSettingsList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings[] _value; + + /// The chap settings entity collection + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ChapSettingsList() + { + + } + } + /// Collection of Chap setting entities + public partial interface IChapSettingsList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The chap settings entity collection + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The chap settings entity collection", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings[] Value { get; set; } + + } + /// Collection of Chap setting entities + internal partial interface IChapSettingsListInternal + + { + /// The chap settings entity collection + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettingsList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettingsList.json.cs new file mode 100644 index 000000000000..5a6eb7d698c1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ChapSettingsList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of Chap setting entities + public partial class ChapSettingsList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal ChapSettingsList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapSettings.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ChapSettingsList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ClearAlertRequest.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ClearAlertRequest.PowerShell.cs new file mode 100644 index 000000000000..d77c73591976 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ClearAlertRequest.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Request for clearing the alert + [System.ComponentModel.TypeConverter(typeof(ClearAlertRequestTypeConverter))] + public partial class ClearAlertRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ClearAlertRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResolutionMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequestInternal)this).ResolutionMessage = (string) content.GetValueForProperty("ResolutionMessage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequestInternal)this).ResolutionMessage, global::System.Convert.ToString); + } + if (content.Contains("Alert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequestInternal)this).Alert = (string[]) content.GetValueForProperty("Alert",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequestInternal)this).Alert, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ClearAlertRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResolutionMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequestInternal)this).ResolutionMessage = (string) content.GetValueForProperty("ResolutionMessage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequestInternal)this).ResolutionMessage, global::System.Convert.ToString); + } + if (content.Contains("Alert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequestInternal)this).Alert = (string[]) content.GetValueForProperty("Alert",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequestInternal)this).Alert, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClearAlertRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClearAlertRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Request for clearing the alert + [System.ComponentModel.TypeConverter(typeof(ClearAlertRequestTypeConverter))] + public partial interface IClearAlertRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ClearAlertRequest.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ClearAlertRequest.TypeConverter.cs new file mode 100644 index 000000000000..f8bcea3c507d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ClearAlertRequest.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ClearAlertRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ClearAlertRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ClearAlertRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ClearAlertRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ClearAlertRequest.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ClearAlertRequest.cs new file mode 100644 index 000000000000..68e654382df3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ClearAlertRequest.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Request for clearing the alert + public partial class ClearAlertRequest : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequestInternal + { + + /// Backing field for property. + private string[] _alert; + + /// List of alert Ids to be cleared + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string[] Alert { get => this._alert; set => this._alert = value; } + + /// Backing field for property. + private string _resolutionMessage; + + /// Resolution message while clearing the request + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ResolutionMessage { get => this._resolutionMessage; set => this._resolutionMessage = value; } + + /// Creates an new instance. + public ClearAlertRequest() + { + + } + } + /// Request for clearing the alert + public partial interface IClearAlertRequest : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// List of alert Ids to be cleared + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of alert Ids to be cleared", + SerializedName = @"alerts", + PossibleTypes = new [] { typeof(string) })] + string[] Alert { get; set; } + /// Resolution message while clearing the request + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resolution message while clearing the request", + SerializedName = @"resolutionMessage", + PossibleTypes = new [] { typeof(string) })] + string ResolutionMessage { get; set; } + + } + /// Request for clearing the alert + internal partial interface IClearAlertRequestInternal + + { + /// List of alert Ids to be cleared + string[] Alert { get; set; } + /// Resolution message while clearing the request + string ResolutionMessage { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ClearAlertRequest.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ClearAlertRequest.json.cs new file mode 100644 index 000000000000..affbdc9d090e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ClearAlertRequest.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Request for clearing the alert + public partial class ClearAlertRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal ClearAlertRequest(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resolutionMessage = If( json?.PropertyT("resolutionMessage"), out var __jsonResolutionMessage) ? (string)__jsonResolutionMessage : (string)ResolutionMessage;} + {_alert = If( json?.PropertyT("alerts"), out var __jsonAlerts) ? If( __jsonAlerts as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Alert;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ClearAlertRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resolutionMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._resolutionMessage.ToString()) : null, "resolutionMessage" ,container.Add ); + if (null != this._alert) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._alert ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("alerts",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequest.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequest.PowerShell.cs new file mode 100644 index 000000000000..7e7a43644858 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequest.PowerShell.cs @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Clone Job Request Model. + [System.ComponentModel.TypeConverter(typeof(CloneRequestTypeConverter))] + public partial class CloneRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CloneRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.CloneRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Share")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).Share = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare) content.GetValueForProperty("Share",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).Share, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("Disk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).Disk, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskTypeConverter.ConvertFrom); + } + if (content.Contains("TargetDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).TargetDeviceId = (string) content.GetValueForProperty("TargetDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).TargetDeviceId, global::System.Convert.ToString); + } + if (content.Contains("TargetAccessPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).TargetAccessPointId = (string) content.GetValueForProperty("TargetAccessPointId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).TargetAccessPointId, global::System.Convert.ToString); + } + if (content.Contains("NewEndpointName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).NewEndpointName = (string) content.GetValueForProperty("NewEndpointName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).NewEndpointName, global::System.Convert.ToString); + } + if (content.Contains("ShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareId = (string) content.GetValueForProperty("ShareId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareId, global::System.Convert.ToString); + } + if (content.Contains("ShareName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareName = (string) content.GetValueForProperty("ShareName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareName, global::System.Convert.ToString); + } + if (content.Contains("ShareType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareType = (string) content.GetValueForProperty("ShareType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareType, global::System.Convert.ToString); + } + if (content.Contains("ShareProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareProperty = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties) content.GetValueForProperty("ShareProperty",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareProperty, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileSharePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ShareStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) content.GetValueForProperty("ShareStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus.CreateFrom); + } + if (content.Contains("SharePropertiesDataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesDataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("SharePropertiesDataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesDataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("SharePropertiesMonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesMonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("SharePropertiesMonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesMonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("DiskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskId = (string) content.GetValueForProperty("DiskId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskId, global::System.Convert.ToString); + } + if (content.Contains("DiskName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskName = (string) content.GetValueForProperty("DiskName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskName, global::System.Convert.ToString); + } + if (content.Contains("DiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskType = (string) content.GetValueForProperty("DiskType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskType, global::System.Convert.ToString); + } + if (content.Contains("DiskProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskProperty = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties) content.GetValueForProperty("DiskProperty",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskProperty, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DiskStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) content.GetValueForProperty("DiskStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus.CreateFrom); + } + if (content.Contains("DiskPropertiesDataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesDataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DiskPropertiesDataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesDataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("DiskPropertiesMonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesMonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("DiskPropertiesMonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesMonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("SharePropertiesDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesDescription = (string) content.GetValueForProperty("SharePropertiesDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesDescription, global::System.Convert.ToString); + } + if (content.Contains("AdminUser")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).AdminUser = (string) content.GetValueForProperty("AdminUser",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).AdminUser, global::System.Convert.ToString); + } + if (content.Contains("SharePropertiesProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesProvisionedCapacityInByte = (long) content.GetValueForProperty("SharePropertiesProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SharePropertiesUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesUsedCapacityInByte = (long?) content.GetValueForProperty("SharePropertiesUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SharePropertiesLocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesLocalUsedCapacityInByte = (long?) content.GetValueForProperty("SharePropertiesLocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesLocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DiskPropertiesDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesDescription = (string) content.GetValueForProperty("DiskPropertiesDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesDescription, global::System.Convert.ToString); + } + if (content.Contains("AccessControlRecord")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).AccessControlRecord = (string[]) content.GetValueForProperty("AccessControlRecord",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).AccessControlRecord, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DiskPropertiesProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesProvisionedCapacityInByte = (long) content.GetValueForProperty("DiskPropertiesProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DiskPropertiesUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesUsedCapacityInByte = (long?) content.GetValueForProperty("DiskPropertiesUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DiskPropertiesLocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesLocalUsedCapacityInByte = (long?) content.GetValueForProperty("DiskPropertiesLocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesLocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CloneRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.CloneRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Share")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).Share = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare) content.GetValueForProperty("Share",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).Share, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("Disk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).Disk, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskTypeConverter.ConvertFrom); + } + if (content.Contains("TargetDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).TargetDeviceId = (string) content.GetValueForProperty("TargetDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).TargetDeviceId, global::System.Convert.ToString); + } + if (content.Contains("TargetAccessPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).TargetAccessPointId = (string) content.GetValueForProperty("TargetAccessPointId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).TargetAccessPointId, global::System.Convert.ToString); + } + if (content.Contains("NewEndpointName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).NewEndpointName = (string) content.GetValueForProperty("NewEndpointName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).NewEndpointName, global::System.Convert.ToString); + } + if (content.Contains("ShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareId = (string) content.GetValueForProperty("ShareId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareId, global::System.Convert.ToString); + } + if (content.Contains("ShareName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareName = (string) content.GetValueForProperty("ShareName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareName, global::System.Convert.ToString); + } + if (content.Contains("ShareType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareType = (string) content.GetValueForProperty("ShareType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareType, global::System.Convert.ToString); + } + if (content.Contains("ShareProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareProperty = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties) content.GetValueForProperty("ShareProperty",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareProperty, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileSharePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ShareStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) content.GetValueForProperty("ShareStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).ShareStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus.CreateFrom); + } + if (content.Contains("SharePropertiesDataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesDataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("SharePropertiesDataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesDataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("SharePropertiesMonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesMonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("SharePropertiesMonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesMonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("DiskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskId = (string) content.GetValueForProperty("DiskId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskId, global::System.Convert.ToString); + } + if (content.Contains("DiskName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskName = (string) content.GetValueForProperty("DiskName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskName, global::System.Convert.ToString); + } + if (content.Contains("DiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskType = (string) content.GetValueForProperty("DiskType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskType, global::System.Convert.ToString); + } + if (content.Contains("DiskProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskProperty = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties) content.GetValueForProperty("DiskProperty",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskProperty, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DiskStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) content.GetValueForProperty("DiskStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus.CreateFrom); + } + if (content.Contains("DiskPropertiesDataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesDataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DiskPropertiesDataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesDataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("DiskPropertiesMonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesMonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("DiskPropertiesMonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesMonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("SharePropertiesDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesDescription = (string) content.GetValueForProperty("SharePropertiesDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesDescription, global::System.Convert.ToString); + } + if (content.Contains("AdminUser")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).AdminUser = (string) content.GetValueForProperty("AdminUser",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).AdminUser, global::System.Convert.ToString); + } + if (content.Contains("SharePropertiesProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesProvisionedCapacityInByte = (long) content.GetValueForProperty("SharePropertiesProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SharePropertiesUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesUsedCapacityInByte = (long?) content.GetValueForProperty("SharePropertiesUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SharePropertiesLocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesLocalUsedCapacityInByte = (long?) content.GetValueForProperty("SharePropertiesLocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).SharePropertiesLocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DiskPropertiesDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesDescription = (string) content.GetValueForProperty("DiskPropertiesDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesDescription, global::System.Convert.ToString); + } + if (content.Contains("AccessControlRecord")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).AccessControlRecord = (string[]) content.GetValueForProperty("AccessControlRecord",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).AccessControlRecord, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DiskPropertiesProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesProvisionedCapacityInByte = (long) content.GetValueForProperty("DiskPropertiesProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DiskPropertiesUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesUsedCapacityInByte = (long?) content.GetValueForProperty("DiskPropertiesUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DiskPropertiesLocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesLocalUsedCapacityInByte = (long?) content.GetValueForProperty("DiskPropertiesLocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal)this).DiskPropertiesLocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloneRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloneRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Clone Job Request Model. + [System.ComponentModel.TypeConverter(typeof(CloneRequestTypeConverter))] + public partial interface ICloneRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequest.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequest.TypeConverter.cs new file mode 100644 index 000000000000..2253d4a52cac --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequest.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CloneRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CloneRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CloneRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CloneRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequest.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequest.cs new file mode 100644 index 000000000000..fd94f85bab29 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequest.cs @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Clone Job Request Model. + public partial class CloneRequest : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal + { + + /// The access control records. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string[] AccessControlRecord { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).AccessControlRecord; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).AccessControlRecord = value ?? null /* arrayOf */; } + + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string AdminUser { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).AdminUser; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).AdminUser = value ?? null; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DiskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskId; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DiskName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskName; } + + /// The data policy. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy? DiskPropertiesDataPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesDataPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesDataPolicy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy)""); } + + /// The description. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DiskPropertiesDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesDescription = value ?? null; } + + /// The local used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DiskPropertiesLocalUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesLocalUsedCapacityInByte; } + + /// The monitoring. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus? DiskPropertiesMonitoringStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesMonitoringStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesMonitoringStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus)""); } + + /// The provisioned capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DiskPropertiesProvisionedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesProvisionedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesProvisionedCapacityInByte = value ?? default(long); } + + /// The used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DiskPropertiesUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesUsedCapacityInByte; } + + /// The disk status. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus? DiskStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus)""); } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DiskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskType; } + + /// Internal Acessors for Disk + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.Disk { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).Disk; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).Disk = value; } + + /// Internal Acessors for DiskId + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.DiskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskId = value; } + + /// Internal Acessors for DiskName + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.DiskName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskName; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskName = value; } + + /// Internal Acessors for DiskPropertiesLocalUsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.DiskPropertiesLocalUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesLocalUsedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesLocalUsedCapacityInByte = value; } + + /// Internal Acessors for DiskPropertiesUsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.DiskPropertiesUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesUsedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskPropertiesUsedCapacityInByte = value; } + + /// Internal Acessors for DiskProperty + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.DiskProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskProperty = value; } + + /// Internal Acessors for DiskType + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.DiskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).DiskType = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.CloneRequestProperties()); set { {_property = value;} } } + + /// Internal Acessors for Share + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.Share { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).Share; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).Share = value; } + + /// Internal Acessors for ShareId + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.ShareId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).ShareId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).ShareId = value; } + + /// Internal Acessors for ShareName + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.ShareName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).ShareName; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).ShareName = value; } + + /// Internal Acessors for SharePropertiesLocalUsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.SharePropertiesLocalUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesLocalUsedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesLocalUsedCapacityInByte = value; } + + /// Internal Acessors for SharePropertiesUsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.SharePropertiesUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesUsedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesUsedCapacityInByte = value; } + + /// Internal Acessors for ShareProperty + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.ShareProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).ShareProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).ShareProperty = value; } + + /// Internal Acessors for ShareType + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestInternal.ShareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).ShareType; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).ShareType = value; } + + /// Name of new endpoint which will created as part of clone job. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string NewEndpointName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).NewEndpointName; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).NewEndpointName = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties _property; + + /// CloneJob Properties are encapsulated in this object. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.CloneRequestProperties()); set => this._property = value; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ShareId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).ShareId; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ShareName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).ShareName; } + + /// The data policy + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy? SharePropertiesDataPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesDataPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesDataPolicy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy)""); } + + /// Description for file share + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string SharePropertiesDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesDescription = value ?? null; } + + /// The local used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? SharePropertiesLocalUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesLocalUsedCapacityInByte; } + + /// The monitoring status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus? SharePropertiesMonitoringStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesMonitoringStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesMonitoringStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus)""); } + + /// The total provisioned capacity in Bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? SharePropertiesProvisionedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesProvisionedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesProvisionedCapacityInByte = value ?? default(long); } + + /// The used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? SharePropertiesUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).SharePropertiesUsedCapacityInByte; } + + /// The Share Status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus? ShareStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).ShareStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).ShareStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus)""); } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ShareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).ShareType; } + + /// Access point Id on which clone job will performed. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string TargetAccessPointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).TargetAccessPointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).TargetAccessPointId = value ; } + + /// DeviceId of the device which will act as the Clone target + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string TargetDeviceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).TargetDeviceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)Property).TargetDeviceId = value ; } + + /// Creates an new instance. + public CloneRequest() + { + + } + } + /// Clone Job Request Model. + public partial interface ICloneRequest : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The access control records. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The access control records.", + SerializedName = @"accessControlRecords", + PossibleTypes = new [] { typeof(string) })] + string[] AccessControlRecord { get; set; } + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\xyz.", + SerializedName = @"adminUser", + PossibleTypes = new [] { typeof(string) })] + string AdminUser { get; set; } + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The identifier.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string DiskId { get; } + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string DiskName { get; } + /// The data policy. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data policy.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy? DiskPropertiesDataPolicy { get; set; } + /// The description. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DiskPropertiesDescription { get; set; } + /// The local used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The local used capacity in bytes.", + SerializedName = @"localUsedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DiskPropertiesLocalUsedCapacityInByte { get; } + /// The monitoring. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The monitoring.", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus? DiskPropertiesMonitoringStatus { get; set; } + /// The provisioned capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The provisioned capacity in bytes.", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DiskPropertiesProvisionedCapacityInByte { get; set; } + /// The used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The used capacity in bytes.", + SerializedName = @"usedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DiskPropertiesUsedCapacityInByte { get; } + /// The disk status. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The disk status.", + SerializedName = @"diskStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus? DiskStatus { get; set; } + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string DiskType { get; } + /// Name of new endpoint which will created as part of clone job. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of new endpoint which will created as part of clone job.", + SerializedName = @"newEndpointName", + PossibleTypes = new [] { typeof(string) })] + string NewEndpointName { get; set; } + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The identifier.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string ShareId { get; } + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ShareName { get; } + /// The data policy + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data policy", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy? SharePropertiesDataPolicy { get; set; } + /// Description for file share + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description for file share", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string SharePropertiesDescription { get; set; } + /// The local used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The local used capacity in Bytes.", + SerializedName = @"localUsedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? SharePropertiesLocalUsedCapacityInByte { get; } + /// The monitoring status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The monitoring status", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus? SharePropertiesMonitoringStatus { get; set; } + /// The total provisioned capacity in Bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total provisioned capacity in Bytes", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? SharePropertiesProvisionedCapacityInByte { get; set; } + /// The used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The used capacity in Bytes.", + SerializedName = @"usedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? SharePropertiesUsedCapacityInByte { get; } + /// The Share Status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Share Status", + SerializedName = @"shareStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus? ShareStatus { get; set; } + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ShareType { get; } + /// Access point Id on which clone job will performed. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Access point Id on which clone job will performed.", + SerializedName = @"targetAccessPointId", + PossibleTypes = new [] { typeof(string) })] + string TargetAccessPointId { get; set; } + /// DeviceId of the device which will act as the Clone target + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"DeviceId of the device which will act as the Clone target", + SerializedName = @"targetDeviceId", + PossibleTypes = new [] { typeof(string) })] + string TargetDeviceId { get; set; } + + } + /// Clone Job Request Model. + internal partial interface ICloneRequestInternal + + { + /// The access control records. + string[] AccessControlRecord { get; set; } + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + string AdminUser { get; set; } + /// Disk Object + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk Disk { get; set; } + /// The identifier. + string DiskId { get; set; } + /// The name. + string DiskName { get; set; } + /// The data policy. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy? DiskPropertiesDataPolicy { get; set; } + /// The description. + string DiskPropertiesDescription { get; set; } + /// The local used capacity in bytes. + long? DiskPropertiesLocalUsedCapacityInByte { get; set; } + /// The monitoring. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus? DiskPropertiesMonitoringStatus { get; set; } + /// The provisioned capacity in bytes. + long? DiskPropertiesProvisionedCapacityInByte { get; set; } + /// The used capacity in bytes. + long? DiskPropertiesUsedCapacityInByte { get; set; } + /// The properties. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties DiskProperty { get; set; } + /// The disk status. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus? DiskStatus { get; set; } + /// The type. + string DiskType { get; set; } + /// Name of new endpoint which will created as part of clone job. + string NewEndpointName { get; set; } + /// CloneJob Properties are encapsulated in this object. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties Property { get; set; } + /// Share Object. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare Share { get; set; } + /// The identifier. + string ShareId { get; set; } + /// The name. + string ShareName { get; set; } + /// The data policy + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy? SharePropertiesDataPolicy { get; set; } + /// Description for file share + string SharePropertiesDescription { get; set; } + /// The local used capacity in Bytes. + long? SharePropertiesLocalUsedCapacityInByte { get; set; } + /// The monitoring status + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus? SharePropertiesMonitoringStatus { get; set; } + /// The total provisioned capacity in Bytes + long? SharePropertiesProvisionedCapacityInByte { get; set; } + /// The used capacity in Bytes. + long? SharePropertiesUsedCapacityInByte { get; set; } + /// The properties. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties ShareProperty { get; set; } + /// The Share Status + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus? ShareStatus { get; set; } + /// The type. + string ShareType { get; set; } + /// Access point Id on which clone job will performed. + string TargetAccessPointId { get; set; } + /// DeviceId of the device which will act as the Clone target + string TargetDeviceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequest.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequest.json.cs new file mode 100644 index 000000000000..fe15f22084b6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequest.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Clone Job Request Model. + public partial class CloneRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal CloneRequest(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.CloneRequestProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new CloneRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequestProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequestProperties.PowerShell.cs new file mode 100644 index 000000000000..a721984ac0da --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequestProperties.PowerShell.cs @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Properties of CloneRequest + [System.ComponentModel.TypeConverter(typeof(CloneRequestPropertiesTypeConverter))] + public partial class CloneRequestProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CloneRequestProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Share")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).Share = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare) content.GetValueForProperty("Share",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).Share, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("Disk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).Disk, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskTypeConverter.ConvertFrom); + } + if (content.Contains("TargetDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).TargetDeviceId = (string) content.GetValueForProperty("TargetDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).TargetDeviceId, global::System.Convert.ToString); + } + if (content.Contains("TargetAccessPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).TargetAccessPointId = (string) content.GetValueForProperty("TargetAccessPointId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).TargetAccessPointId, global::System.Convert.ToString); + } + if (content.Contains("NewEndpointName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).NewEndpointName = (string) content.GetValueForProperty("NewEndpointName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).NewEndpointName, global::System.Convert.ToString); + } + if (content.Contains("ShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareId = (string) content.GetValueForProperty("ShareId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareId, global::System.Convert.ToString); + } + if (content.Contains("ShareName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareName = (string) content.GetValueForProperty("ShareName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareName, global::System.Convert.ToString); + } + if (content.Contains("ShareType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareType = (string) content.GetValueForProperty("ShareType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareType, global::System.Convert.ToString); + } + if (content.Contains("ShareProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareProperty = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties) content.GetValueForProperty("ShareProperty",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareProperty, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileSharePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ShareStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) content.GetValueForProperty("ShareStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus.CreateFrom); + } + if (content.Contains("SharePropertiesDataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesDataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("SharePropertiesDataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesDataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("SharePropertiesMonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesMonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("SharePropertiesMonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesMonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("DiskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskId = (string) content.GetValueForProperty("DiskId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskId, global::System.Convert.ToString); + } + if (content.Contains("DiskName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskName = (string) content.GetValueForProperty("DiskName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskName, global::System.Convert.ToString); + } + if (content.Contains("DiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskType = (string) content.GetValueForProperty("DiskType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskType, global::System.Convert.ToString); + } + if (content.Contains("DiskProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskProperty = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties) content.GetValueForProperty("DiskProperty",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskProperty, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DiskStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) content.GetValueForProperty("DiskStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus.CreateFrom); + } + if (content.Contains("DiskPropertiesDataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesDataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DiskPropertiesDataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesDataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("DiskPropertiesMonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesMonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("DiskPropertiesMonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesMonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("SharePropertiesDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesDescription = (string) content.GetValueForProperty("SharePropertiesDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesDescription, global::System.Convert.ToString); + } + if (content.Contains("AdminUser")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).AdminUser = (string) content.GetValueForProperty("AdminUser",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).AdminUser, global::System.Convert.ToString); + } + if (content.Contains("SharePropertiesProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesProvisionedCapacityInByte = (long) content.GetValueForProperty("SharePropertiesProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SharePropertiesUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesUsedCapacityInByte = (long?) content.GetValueForProperty("SharePropertiesUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SharePropertiesLocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesLocalUsedCapacityInByte = (long?) content.GetValueForProperty("SharePropertiesLocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesLocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DiskPropertiesDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesDescription = (string) content.GetValueForProperty("DiskPropertiesDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesDescription, global::System.Convert.ToString); + } + if (content.Contains("AccessControlRecord")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).AccessControlRecord = (string[]) content.GetValueForProperty("AccessControlRecord",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).AccessControlRecord, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DiskPropertiesProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesProvisionedCapacityInByte = (long) content.GetValueForProperty("DiskPropertiesProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DiskPropertiesUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesUsedCapacityInByte = (long?) content.GetValueForProperty("DiskPropertiesUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DiskPropertiesLocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesLocalUsedCapacityInByte = (long?) content.GetValueForProperty("DiskPropertiesLocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesLocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CloneRequestProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Share")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).Share = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare) content.GetValueForProperty("Share",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).Share, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShareTypeConverter.ConvertFrom); + } + if (content.Contains("Disk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).Disk, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskTypeConverter.ConvertFrom); + } + if (content.Contains("TargetDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).TargetDeviceId = (string) content.GetValueForProperty("TargetDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).TargetDeviceId, global::System.Convert.ToString); + } + if (content.Contains("TargetAccessPointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).TargetAccessPointId = (string) content.GetValueForProperty("TargetAccessPointId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).TargetAccessPointId, global::System.Convert.ToString); + } + if (content.Contains("NewEndpointName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).NewEndpointName = (string) content.GetValueForProperty("NewEndpointName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).NewEndpointName, global::System.Convert.ToString); + } + if (content.Contains("ShareId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareId = (string) content.GetValueForProperty("ShareId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareId, global::System.Convert.ToString); + } + if (content.Contains("ShareName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareName = (string) content.GetValueForProperty("ShareName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareName, global::System.Convert.ToString); + } + if (content.Contains("ShareType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareType = (string) content.GetValueForProperty("ShareType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareType, global::System.Convert.ToString); + } + if (content.Contains("ShareProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareProperty = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties) content.GetValueForProperty("ShareProperty",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareProperty, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileSharePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ShareStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) content.GetValueForProperty("ShareStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).ShareStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus.CreateFrom); + } + if (content.Contains("SharePropertiesDataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesDataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("SharePropertiesDataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesDataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("SharePropertiesMonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesMonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("SharePropertiesMonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesMonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("DiskId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskId = (string) content.GetValueForProperty("DiskId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskId, global::System.Convert.ToString); + } + if (content.Contains("DiskName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskName = (string) content.GetValueForProperty("DiskName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskName, global::System.Convert.ToString); + } + if (content.Contains("DiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskType = (string) content.GetValueForProperty("DiskType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskType, global::System.Convert.ToString); + } + if (content.Contains("DiskProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskProperty = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties) content.GetValueForProperty("DiskProperty",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskProperty, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DiskStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) content.GetValueForProperty("DiskStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus.CreateFrom); + } + if (content.Contains("DiskPropertiesDataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesDataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DiskPropertiesDataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesDataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("DiskPropertiesMonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesMonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("DiskPropertiesMonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesMonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("SharePropertiesDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesDescription = (string) content.GetValueForProperty("SharePropertiesDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesDescription, global::System.Convert.ToString); + } + if (content.Contains("AdminUser")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).AdminUser = (string) content.GetValueForProperty("AdminUser",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).AdminUser, global::System.Convert.ToString); + } + if (content.Contains("SharePropertiesProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesProvisionedCapacityInByte = (long) content.GetValueForProperty("SharePropertiesProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SharePropertiesUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesUsedCapacityInByte = (long?) content.GetValueForProperty("SharePropertiesUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SharePropertiesLocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesLocalUsedCapacityInByte = (long?) content.GetValueForProperty("SharePropertiesLocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).SharePropertiesLocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DiskPropertiesDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesDescription = (string) content.GetValueForProperty("DiskPropertiesDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesDescription, global::System.Convert.ToString); + } + if (content.Contains("AccessControlRecord")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).AccessControlRecord = (string[]) content.GetValueForProperty("AccessControlRecord",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).AccessControlRecord, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DiskPropertiesProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesProvisionedCapacityInByte = (long) content.GetValueForProperty("DiskPropertiesProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DiskPropertiesUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesUsedCapacityInByte = (long?) content.GetValueForProperty("DiskPropertiesUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DiskPropertiesLocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesLocalUsedCapacityInByte = (long?) content.GetValueForProperty("DiskPropertiesLocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal)this).DiskPropertiesLocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloneRequestProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloneRequestProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of CloneRequest + [System.ComponentModel.TypeConverter(typeof(CloneRequestPropertiesTypeConverter))] + public partial interface ICloneRequestProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequestProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequestProperties.TypeConverter.cs new file mode 100644 index 000000000000..31af7c5865cd --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequestProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CloneRequestPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CloneRequestProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CloneRequestProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CloneRequestProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequestProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequestProperties.cs new file mode 100644 index 000000000000..cad65dbef3cf --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequestProperties.cs @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Properties of CloneRequest + public partial class CloneRequestProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal + { + + /// The access control records. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string[] AccessControlRecord { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).AccessControlRecord; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).AccessControlRecord = value ?? null /* arrayOf */; } + + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string AdminUser { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).AdminUser; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).AdminUser = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk _disk; + + /// Disk Object + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk Disk { get => (this._disk = this._disk ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDisk()); set => this._disk = value; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DiskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Disk).Id; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DiskName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Disk).Name; } + + /// The data policy. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy? DiskPropertiesDataPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).DataPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).DataPolicy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy)""); } + + /// The description. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DiskPropertiesDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).Description = value ?? null; } + + /// The local used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DiskPropertiesLocalUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).LocalUsedCapacityInByte; } + + /// The monitoring. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus? DiskPropertiesMonitoringStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).MonitoringStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).MonitoringStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus)""); } + + /// The provisioned capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DiskPropertiesProvisionedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).ProvisionedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).ProvisionedCapacityInByte = value ?? default(long); } + + /// The used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DiskPropertiesUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).UsedCapacityInByte; } + + /// The disk status. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus? DiskStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).DiskStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).DiskStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus)""); } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DiskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Disk).Type; } + + /// Internal Acessors for Disk + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.Disk { get => (this._disk = this._disk ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDisk()); set { {_disk = value;} } } + + /// Internal Acessors for DiskId + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.DiskId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Disk).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Disk).Id = value; } + + /// Internal Acessors for DiskName + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.DiskName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Disk).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Disk).Name = value; } + + /// Internal Acessors for DiskPropertiesLocalUsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.DiskPropertiesLocalUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).LocalUsedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).LocalUsedCapacityInByte = value; } + + /// Internal Acessors for DiskPropertiesUsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.DiskPropertiesUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).UsedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).UsedCapacityInByte = value; } + + /// Internal Acessors for DiskProperty + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.DiskProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)Disk).Property = value; } + + /// Internal Acessors for DiskType + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.DiskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Disk).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Disk).Type = value; } + + /// Internal Acessors for Share + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.Share { get => (this._share = this._share ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShare()); set { {_share = value;} } } + + /// Internal Acessors for ShareId + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.ShareId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Share).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Share).Id = value; } + + /// Internal Acessors for ShareName + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.ShareName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Share).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Share).Name = value; } + + /// Internal Acessors for SharePropertiesLocalUsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.SharePropertiesLocalUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).LocalUsedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).LocalUsedCapacityInByte = value; } + + /// Internal Acessors for SharePropertiesUsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.SharePropertiesUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).UsedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).UsedCapacityInByte = value; } + + /// Internal Acessors for ShareProperty + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.ShareProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).Property = value; } + + /// Internal Acessors for ShareType + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestPropertiesInternal.ShareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Share).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Share).Type = value; } + + /// Backing field for property. + private string _newEndpointName; + + /// Name of new endpoint which will created as part of clone job. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string NewEndpointName { get => this._newEndpointName; set => this._newEndpointName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare _share; + + /// Share Object. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare Share { get => (this._share = this._share ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShare()); set => this._share = value; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ShareId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Share).Id; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ShareName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Share).Name; } + + /// The data policy + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy? SharePropertiesDataPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).DataPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).DataPolicy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy)""); } + + /// Description for file share + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string SharePropertiesDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).Description = value ?? null; } + + /// The local used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? SharePropertiesLocalUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).LocalUsedCapacityInByte; } + + /// The monitoring status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus? SharePropertiesMonitoringStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).MonitoringStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).MonitoringStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus)""); } + + /// The total provisioned capacity in Bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? SharePropertiesProvisionedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).ProvisionedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).ProvisionedCapacityInByte = value ?? default(long); } + + /// The used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? SharePropertiesUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).UsedCapacityInByte; } + + /// The Share Status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus? ShareStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).ShareStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)Share).ShareStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus)""); } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ShareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)Share).Type; } + + /// Backing field for property. + private string _targetAccessPointId; + + /// Access point Id on which clone job will performed. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string TargetAccessPointId { get => this._targetAccessPointId; set => this._targetAccessPointId = value; } + + /// Backing field for property. + private string _targetDeviceId; + + /// DeviceId of the device which will act as the Clone target + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string TargetDeviceId { get => this._targetDeviceId; set => this._targetDeviceId = value; } + + /// Creates an new instance. + public CloneRequestProperties() + { + + } + } + /// Properties of CloneRequest + public partial interface ICloneRequestProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The access control records. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The access control records.", + SerializedName = @"accessControlRecords", + PossibleTypes = new [] { typeof(string) })] + string[] AccessControlRecord { get; set; } + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\xyz.", + SerializedName = @"adminUser", + PossibleTypes = new [] { typeof(string) })] + string AdminUser { get; set; } + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The identifier.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string DiskId { get; } + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string DiskName { get; } + /// The data policy. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data policy.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy? DiskPropertiesDataPolicy { get; set; } + /// The description. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DiskPropertiesDescription { get; set; } + /// The local used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The local used capacity in bytes.", + SerializedName = @"localUsedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DiskPropertiesLocalUsedCapacityInByte { get; } + /// The monitoring. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The monitoring.", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus? DiskPropertiesMonitoringStatus { get; set; } + /// The provisioned capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The provisioned capacity in bytes.", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DiskPropertiesProvisionedCapacityInByte { get; set; } + /// The used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The used capacity in bytes.", + SerializedName = @"usedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DiskPropertiesUsedCapacityInByte { get; } + /// The disk status. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The disk status.", + SerializedName = @"diskStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus? DiskStatus { get; set; } + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string DiskType { get; } + /// Name of new endpoint which will created as part of clone job. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of new endpoint which will created as part of clone job.", + SerializedName = @"newEndpointName", + PossibleTypes = new [] { typeof(string) })] + string NewEndpointName { get; set; } + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The identifier.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string ShareId { get; } + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ShareName { get; } + /// The data policy + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data policy", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy? SharePropertiesDataPolicy { get; set; } + /// Description for file share + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description for file share", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string SharePropertiesDescription { get; set; } + /// The local used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The local used capacity in Bytes.", + SerializedName = @"localUsedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? SharePropertiesLocalUsedCapacityInByte { get; } + /// The monitoring status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The monitoring status", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus? SharePropertiesMonitoringStatus { get; set; } + /// The total provisioned capacity in Bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total provisioned capacity in Bytes", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? SharePropertiesProvisionedCapacityInByte { get; set; } + /// The used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The used capacity in Bytes.", + SerializedName = @"usedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? SharePropertiesUsedCapacityInByte { get; } + /// The Share Status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Share Status", + SerializedName = @"shareStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus? ShareStatus { get; set; } + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ShareType { get; } + /// Access point Id on which clone job will performed. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Access point Id on which clone job will performed.", + SerializedName = @"targetAccessPointId", + PossibleTypes = new [] { typeof(string) })] + string TargetAccessPointId { get; set; } + /// DeviceId of the device which will act as the Clone target + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"DeviceId of the device which will act as the Clone target", + SerializedName = @"targetDeviceId", + PossibleTypes = new [] { typeof(string) })] + string TargetDeviceId { get; set; } + + } + /// Properties of CloneRequest + internal partial interface ICloneRequestPropertiesInternal + + { + /// The access control records. + string[] AccessControlRecord { get; set; } + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + string AdminUser { get; set; } + /// Disk Object + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk Disk { get; set; } + /// The identifier. + string DiskId { get; set; } + /// The name. + string DiskName { get; set; } + /// The data policy. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy? DiskPropertiesDataPolicy { get; set; } + /// The description. + string DiskPropertiesDescription { get; set; } + /// The local used capacity in bytes. + long? DiskPropertiesLocalUsedCapacityInByte { get; set; } + /// The monitoring. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus? DiskPropertiesMonitoringStatus { get; set; } + /// The provisioned capacity in bytes. + long? DiskPropertiesProvisionedCapacityInByte { get; set; } + /// The used capacity in bytes. + long? DiskPropertiesUsedCapacityInByte { get; set; } + /// The properties. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties DiskProperty { get; set; } + /// The disk status. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus? DiskStatus { get; set; } + /// The type. + string DiskType { get; set; } + /// Name of new endpoint which will created as part of clone job. + string NewEndpointName { get; set; } + /// Share Object. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare Share { get; set; } + /// The identifier. + string ShareId { get; set; } + /// The name. + string ShareName { get; set; } + /// The data policy + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy? SharePropertiesDataPolicy { get; set; } + /// Description for file share + string SharePropertiesDescription { get; set; } + /// The local used capacity in Bytes. + long? SharePropertiesLocalUsedCapacityInByte { get; set; } + /// The monitoring status + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus? SharePropertiesMonitoringStatus { get; set; } + /// The total provisioned capacity in Bytes + long? SharePropertiesProvisionedCapacityInByte { get; set; } + /// The used capacity in Bytes. + long? SharePropertiesUsedCapacityInByte { get; set; } + /// The properties. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties ShareProperty { get; set; } + /// The Share Status + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus? ShareStatus { get; set; } + /// The type. + string ShareType { get; set; } + /// Access point Id on which clone job will performed. + string TargetAccessPointId { get; set; } + /// DeviceId of the device which will act as the Clone target + string TargetDeviceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequestProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequestProperties.json.cs new file mode 100644 index 000000000000..f443368bdbac --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/CloneRequestProperties.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Properties of CloneRequest + public partial class CloneRequestProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal CloneRequestProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_share = If( json?.PropertyT("share"), out var __jsonShare) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShare.FromJson(__jsonShare) : Share;} + {_disk = If( json?.PropertyT("disk"), out var __jsonDisk) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDisk.FromJson(__jsonDisk) : Disk;} + {_targetDeviceId = If( json?.PropertyT("targetDeviceId"), out var __jsonTargetDeviceId) ? (string)__jsonTargetDeviceId : (string)TargetDeviceId;} + {_targetAccessPointId = If( json?.PropertyT("targetAccessPointId"), out var __jsonTargetAccessPointId) ? (string)__jsonTargetAccessPointId : (string)TargetAccessPointId;} + {_newEndpointName = If( json?.PropertyT("newEndpointName"), out var __jsonNewEndpointName) ? (string)__jsonNewEndpointName : (string)NewEndpointName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new CloneRequestProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._share ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._share.ToJson(null,serializationMode) : null, "share" ,container.Add ); + AddIf( null != this._disk ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._disk.ToJson(null,serializationMode) : null, "disk" ,container.Add ); + AddIf( null != (((object)this._targetDeviceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._targetDeviceId.ToString()) : null, "targetDeviceId" ,container.Add ); + AddIf( null != (((object)this._targetAccessPointId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._targetAccessPointId.ToString()) : null, "targetAccessPointId" ,container.Add ); + AddIf( null != (((object)this._newEndpointName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._newEndpointName.ToString()) : null, "newEndpointName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Device.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Device.PowerShell.cs new file mode 100644 index 000000000000..f26e83442982 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Device.PowerShell.cs @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Represents a StorSimple device object along with its properties + [System.ComponentModel.TypeConverter(typeof(DeviceTypeConverter))] + public partial class Device + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Device(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Device(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Device(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DevicePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ActivationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).ActivationTime = (global::System.DateTime?) content.GetValueForProperty("ActivationTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).ActivationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AllowedDeviceOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).AllowedDeviceOperation = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation[]) content.GetValueForProperty("AllowedDeviceOperation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).AllowedDeviceOperation, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation.CreateFrom)); + } + if (content.Contains("Culture")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Culture = (string) content.GetValueForProperty("Culture",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Culture, global::System.Convert.ToString); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities.CreateFrom)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("SoftwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).SoftwareVersion = (string) content.GetValueForProperty("SoftwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).SoftwareVersion, global::System.Convert.ToString); + } + if (content.Contains("FriendlySoftwareName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).FriendlySoftwareName = (string) content.GetValueForProperty("FriendlySoftwareName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).FriendlySoftwareName, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).ConfigurationStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus?) content.GetValueForProperty("ConfigurationStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).ConfigurationStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus.CreateFrom); + } + if (content.Contains("ModelDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).ModelDescription = (string) content.GetValueForProperty("ModelDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).ModelDescription, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus.CreateFrom); + } + if (content.Contains("PropertiesType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).PropertiesType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType?) content.GetValueForProperty("PropertiesType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).PropertiesType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType.CreateFrom); + } + if (content.Contains("DetailEndpointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailEndpointCount = (int?) content.GetValueForProperty("DetailEndpointCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailEndpointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DetailTotalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailTotalStorageInByte = (long?) content.GetValueForProperty("DetailTotalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailTotalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailTotalLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailTotalLocalStorageInByte = (long?) content.GetValueForProperty("DetailTotalLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailTotalLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailProvisionedStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailProvisionedStorageInByte = (long?) content.GetValueForProperty("DetailProvisionedStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailProvisionedStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailProvisionedLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailProvisionedLocalStorageInByte = (long?) content.GetValueForProperty("DetailProvisionedLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailProvisionedLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailUsingStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailUsingStorageInByte = (long?) content.GetValueForProperty("DetailUsingStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailUsingStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailUsingLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailUsingLocalStorageInByte = (long?) content.GetValueForProperty("DetailUsingLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailUsingLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailTotalBackupSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailTotalBackupSizeInByte = (long?) content.GetValueForProperty("DetailTotalBackupSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailTotalBackupSizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailAvailableStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailAvailableStorageInByte = (long?) content.GetValueForProperty("DetailAvailableStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailAvailableStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailAvailableLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailAvailableLocalStorageInByte = (long?) content.GetValueForProperty("DetailAvailableLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailAvailableLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Device(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DevicePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ActivationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).ActivationTime = (global::System.DateTime?) content.GetValueForProperty("ActivationTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).ActivationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AllowedDeviceOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).AllowedDeviceOperation = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation[]) content.GetValueForProperty("AllowedDeviceOperation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).AllowedDeviceOperation, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation.CreateFrom)); + } + if (content.Contains("Culture")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Culture = (string) content.GetValueForProperty("Culture",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Culture, global::System.Convert.ToString); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities.CreateFrom)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("SoftwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).SoftwareVersion = (string) content.GetValueForProperty("SoftwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).SoftwareVersion, global::System.Convert.ToString); + } + if (content.Contains("FriendlySoftwareName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).FriendlySoftwareName = (string) content.GetValueForProperty("FriendlySoftwareName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).FriendlySoftwareName, global::System.Convert.ToString); + } + if (content.Contains("ConfigurationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).ConfigurationStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus?) content.GetValueForProperty("ConfigurationStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).ConfigurationStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus.CreateFrom); + } + if (content.Contains("ModelDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).ModelDescription = (string) content.GetValueForProperty("ModelDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).ModelDescription, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus.CreateFrom); + } + if (content.Contains("PropertiesType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).PropertiesType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType?) content.GetValueForProperty("PropertiesType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).PropertiesType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType.CreateFrom); + } + if (content.Contains("DetailEndpointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailEndpointCount = (int?) content.GetValueForProperty("DetailEndpointCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailEndpointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DetailTotalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailTotalStorageInByte = (long?) content.GetValueForProperty("DetailTotalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailTotalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailTotalLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailTotalLocalStorageInByte = (long?) content.GetValueForProperty("DetailTotalLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailTotalLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailProvisionedStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailProvisionedStorageInByte = (long?) content.GetValueForProperty("DetailProvisionedStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailProvisionedStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailProvisionedLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailProvisionedLocalStorageInByte = (long?) content.GetValueForProperty("DetailProvisionedLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailProvisionedLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailUsingStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailUsingStorageInByte = (long?) content.GetValueForProperty("DetailUsingStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailUsingStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailUsingLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailUsingLocalStorageInByte = (long?) content.GetValueForProperty("DetailUsingLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailUsingLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailTotalBackupSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailTotalBackupSizeInByte = (long?) content.GetValueForProperty("DetailTotalBackupSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailTotalBackupSizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailAvailableStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailAvailableStorageInByte = (long?) content.GetValueForProperty("DetailAvailableStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailAvailableStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailAvailableLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailAvailableLocalStorageInByte = (long?) content.GetValueForProperty("DetailAvailableLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal)this).DetailAvailableLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Represents a StorSimple device object along with its properties + [System.ComponentModel.TypeConverter(typeof(DeviceTypeConverter))] + public partial interface IDevice + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Device.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Device.TypeConverter.cs new file mode 100644 index 000000000000..2973205e9190 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Device.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeviceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Device.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Device.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Device.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Device.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Device.cs new file mode 100644 index 000000000000..1e19660a4ea6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Device.cs @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Represents a StorSimple device object along with its properties + public partial class Device : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The UTC time at which the device was activated + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime? ActivationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).ActivationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).ActivationTime = value ?? default(global::System.DateTime); } + + /// Operations that are allowed on the device based on its current state + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation[] AllowedDeviceOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).AllowedDeviceOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).AllowedDeviceOperation = value ?? null /* arrayOf */; } + + /// Device can be configured either as FileServer or IscsiServer + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities[] Capability { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DeviceCapability; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DeviceCapability = value ?? null /* arrayOf */; } + + /// + /// "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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus? ConfigurationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DeviceConfigurationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DeviceConfigurationStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus)""); } + + /// Language culture setting on the device. For eg: "en-US" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Culture { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).Culture; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).Culture = value ?? null; } + + /// Short description given for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DeviceDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DeviceDescription = value ?? null; } + + /// Local pending storage available on the device in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailAvailableLocalStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailAvailableLocalStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailAvailableLocalStorageInByte = value ?? default(long); } + + /// Total pending available storage on the device in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailAvailableStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailAvailableStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailAvailableStorageInByte = value ?? default(long); } + + /// + /// Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes + /// on IscsiServer) + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? DetailEndpointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailEndpointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailEndpointCount = value ?? default(int); } + + /// Storage in bytes that has been provisioned locally on the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailProvisionedLocalStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailProvisionedLocalStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailProvisionedLocalStorageInByte = value ?? default(long); } + + /// + /// Storage in bytes that has been provisioned on the device including both local and cloud + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailProvisionedStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailProvisionedStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailProvisionedStorageInByte = value ?? default(long); } + + /// Total size taken up by backups in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailTotalBackupSizeInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailTotalBackupSizeInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailTotalBackupSizeInByte = value ?? default(long); } + + /// Total local storage capacity in device in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailTotalLocalStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailTotalLocalStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailTotalLocalStorageInByte = value ?? default(long); } + + /// Total storage available on the device in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailTotalStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailTotalStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailTotalStorageInByte = value ?? default(long); } + + /// Local Storage that is being currently used in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailUsingLocalStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailUsingLocalStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailUsingLocalStorageInByte = value ?? default(long); } + + /// Storage that is being currently used in bytes including both local and cloud + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailUsingStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailUsingStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DetailUsingStorageInByte = value ?? default(long); } + + /// Fully qualified name of the domain to which the device is attached + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DomainName = value ?? null; } + + /// Friendly name for the software version + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string FriendlySoftwareName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).FriendlySoftwareName; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).FriendlySoftwareName = value ?? null; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).Detail = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceProperties()); set { {_property = value;} } } + + /// Name of the device model + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ModelDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).ModelDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).ModelDescription = value ?? null; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Type of the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType? PropertiesType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties _property; + + /// Collection of properties for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceProperties()); set => this._property = value; } + + /// Version number of the software running on the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string SoftwareVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DeviceSoftwareVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).DeviceSoftwareVersion = value ?? null; } + + /// Current status of the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus)""); } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public Device() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// Represents a StorSimple device object along with its properties + public partial interface IDevice : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// The UTC time at which the device was activated + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The UTC time at which the device was activated", + SerializedName = @"activationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ActivationTime { get; set; } + /// Operations that are allowed on the device based on its current state + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operations that are allowed on the device based on its current state", + SerializedName = @"allowedDeviceOperations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation[] AllowedDeviceOperation { get; set; } + /// Device can be configured either as FileServer or IscsiServer + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Device can be configured either as FileServer or IscsiServer", + SerializedName = @"deviceCapabilities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities[] Capability { get; set; } + /// + /// "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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"""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", + SerializedName = @"deviceConfigurationStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus? ConfigurationStatus { get; set; } + /// Language culture setting on the device. For eg: "en-US" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Language culture setting on the device. For eg: ""en-US""", + SerializedName = @"culture", + PossibleTypes = new [] { typeof(string) })] + string Culture { get; set; } + /// Short description given for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Short description given for the device", + SerializedName = @"deviceDescription", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Local pending storage available on the device in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Local pending storage available on the device in bytes", + SerializedName = @"availableLocalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailAvailableLocalStorageInByte { get; set; } + /// Total pending available storage on the device in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total pending available storage on the device in bytes", + SerializedName = @"availableStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailAvailableStorageInByte { get; set; } + /// + /// Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes + /// on IscsiServer) + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes on IscsiServer)", + SerializedName = @"endpointCount", + PossibleTypes = new [] { typeof(int) })] + int? DetailEndpointCount { get; set; } + /// Storage in bytes that has been provisioned locally on the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage in bytes that has been provisioned locally on the device", + SerializedName = @"provisionedLocalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailProvisionedLocalStorageInByte { get; set; } + /// + /// Storage in bytes that has been provisioned on the device including both local and cloud + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage in bytes that has been provisioned on the device including both local and cloud", + SerializedName = @"provisionedStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailProvisionedStorageInByte { get; set; } + /// Total size taken up by backups in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total size taken up by backups in bytes", + SerializedName = @"totalBackupSizeInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailTotalBackupSizeInByte { get; set; } + /// Total local storage capacity in device in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total local storage capacity in device in bytes.", + SerializedName = @"totalLocalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailTotalLocalStorageInByte { get; set; } + /// Total storage available on the device in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total storage available on the device in bytes.", + SerializedName = @"totalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailTotalStorageInByte { get; set; } + /// Local Storage that is being currently used in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Local Storage that is being currently used in bytes", + SerializedName = @"usingLocalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailUsingLocalStorageInByte { get; set; } + /// Storage that is being currently used in bytes including both local and cloud + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage that is being currently used in bytes including both local and cloud", + SerializedName = @"usingStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailUsingStorageInByte { get; set; } + /// Fully qualified name of the domain to which the device is attached + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified name of the domain to which the device is attached", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string DomainName { get; set; } + /// Friendly name for the software version + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name for the software version", + SerializedName = @"friendlySoftwareName", + PossibleTypes = new [] { typeof(string) })] + string FriendlySoftwareName { get; set; } + /// Name of the device model + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the device model", + SerializedName = @"modelDescription", + PossibleTypes = new [] { typeof(string) })] + string ModelDescription { get; set; } + /// Type of the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the device", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType? PropertiesType { get; set; } + /// Version number of the software running on the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version number of the software running on the device", + SerializedName = @"deviceSoftwareVersion", + PossibleTypes = new [] { typeof(string) })] + string SoftwareVersion { get; set; } + /// Current status of the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Current status of the device", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus? Status { get; set; } + + } + /// Represents a StorSimple device object along with its properties + internal partial interface IDeviceInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The UTC time at which the device was activated + global::System.DateTime? ActivationTime { get; set; } + /// Operations that are allowed on the device based on its current state + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation[] AllowedDeviceOperation { get; set; } + /// Device can be configured either as FileServer or IscsiServer + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities[] Capability { get; set; } + /// + /// "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 + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus? ConfigurationStatus { get; set; } + /// Language culture setting on the device. For eg: "en-US" + string Culture { get; set; } + /// Short description given for the device + string Description { get; set; } + /// + /// subclass containing more storage-related information about the device. This field will be populated only if the get call + /// is made with $expand = details. + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails Detail { get; set; } + /// Local pending storage available on the device in bytes + long? DetailAvailableLocalStorageInByte { get; set; } + /// Total pending available storage on the device in bytes + long? DetailAvailableStorageInByte { get; set; } + /// + /// Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes + /// on IscsiServer) + /// + int? DetailEndpointCount { get; set; } + /// Storage in bytes that has been provisioned locally on the device + long? DetailProvisionedLocalStorageInByte { get; set; } + /// + /// Storage in bytes that has been provisioned on the device including both local and cloud + /// + long? DetailProvisionedStorageInByte { get; set; } + /// Total size taken up by backups in bytes + long? DetailTotalBackupSizeInByte { get; set; } + /// Total local storage capacity in device in bytes. + long? DetailTotalLocalStorageInByte { get; set; } + /// Total storage available on the device in bytes. + long? DetailTotalStorageInByte { get; set; } + /// Local Storage that is being currently used in bytes + long? DetailUsingLocalStorageInByte { get; set; } + /// Storage that is being currently used in bytes including both local and cloud + long? DetailUsingStorageInByte { get; set; } + /// Fully qualified name of the domain to which the device is attached + string DomainName { get; set; } + /// Friendly name for the software version + string FriendlySoftwareName { get; set; } + /// Name of the device model + string ModelDescription { get; set; } + /// Type of the device + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType? PropertiesType { get; set; } + /// Collection of properties for the device + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties Property { get; set; } + /// Version number of the software running on the device + string SoftwareVersion { get; set; } + /// Current status of the device + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Device.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Device.json.cs new file mode 100644 index 000000000000..0b33428bf437 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Device.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Represents a StorSimple device object along with its properties + public partial class Device + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal Device(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new Device(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceDetails.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceDetails.PowerShell.cs new file mode 100644 index 000000000000..cb40608dc583 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceDetails.PowerShell.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Class containing more granular details about the device + [System.ComponentModel.TypeConverter(typeof(DeviceDetailsTypeConverter))] + public partial class DeviceDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeviceDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeviceDetails(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeviceDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EndpointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).EndpointCount = (int?) content.GetValueForProperty("EndpointCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).EndpointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).TotalStorageInByte = (long?) content.GetValueForProperty("TotalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).TotalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).TotalLocalStorageInByte = (long?) content.GetValueForProperty("TotalLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).TotalLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ProvisionedStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).ProvisionedStorageInByte = (long?) content.GetValueForProperty("ProvisionedStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).ProvisionedStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ProvisionedLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).ProvisionedLocalStorageInByte = (long?) content.GetValueForProperty("ProvisionedLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).ProvisionedLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UsingStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).UsingStorageInByte = (long?) content.GetValueForProperty("UsingStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).UsingStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UsingLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).UsingLocalStorageInByte = (long?) content.GetValueForProperty("UsingLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).UsingLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalBackupSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).TotalBackupSizeInByte = (long?) content.GetValueForProperty("TotalBackupSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).TotalBackupSizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AvailableStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).AvailableStorageInByte = (long?) content.GetValueForProperty("AvailableStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).AvailableStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AvailableLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).AvailableLocalStorageInByte = (long?) content.GetValueForProperty("AvailableLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).AvailableLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeviceDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EndpointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).EndpointCount = (int?) content.GetValueForProperty("EndpointCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).EndpointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).TotalStorageInByte = (long?) content.GetValueForProperty("TotalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).TotalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).TotalLocalStorageInByte = (long?) content.GetValueForProperty("TotalLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).TotalLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ProvisionedStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).ProvisionedStorageInByte = (long?) content.GetValueForProperty("ProvisionedStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).ProvisionedStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ProvisionedLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).ProvisionedLocalStorageInByte = (long?) content.GetValueForProperty("ProvisionedLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).ProvisionedLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UsingStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).UsingStorageInByte = (long?) content.GetValueForProperty("UsingStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).UsingStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UsingLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).UsingLocalStorageInByte = (long?) content.GetValueForProperty("UsingLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).UsingLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalBackupSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).TotalBackupSizeInByte = (long?) content.GetValueForProperty("TotalBackupSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).TotalBackupSizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AvailableStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).AvailableStorageInByte = (long?) content.GetValueForProperty("AvailableStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).AvailableStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AvailableLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).AvailableLocalStorageInByte = (long?) content.GetValueForProperty("AvailableLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)this).AvailableLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Class containing more granular details about the device + [System.ComponentModel.TypeConverter(typeof(DeviceDetailsTypeConverter))] + public partial interface IDeviceDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceDetails.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceDetails.TypeConverter.cs new file mode 100644 index 000000000000..4d6bcc0d91ec --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceDetails.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeviceDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeviceDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeviceDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeviceDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceDetails.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceDetails.cs new file mode 100644 index 000000000000..c7a4fcb046ef --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceDetails.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class containing more granular details about the device + public partial class DeviceDetails : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal + { + + /// Backing field for property. + private long? _availableLocalStorageInByte; + + /// Local pending storage available on the device in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? AvailableLocalStorageInByte { get => this._availableLocalStorageInByte; set => this._availableLocalStorageInByte = value; } + + /// Backing field for property. + private long? _availableStorageInByte; + + /// Total pending available storage on the device in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? AvailableStorageInByte { get => this._availableStorageInByte; set => this._availableStorageInByte = value; } + + /// Backing field for property. + private int? _endpointCount; + + /// + /// Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes + /// on IscsiServer) + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? EndpointCount { get => this._endpointCount; set => this._endpointCount = value; } + + /// Backing field for property. + private long? _provisionedLocalStorageInByte; + + /// Storage in bytes that has been provisioned locally on the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? ProvisionedLocalStorageInByte { get => this._provisionedLocalStorageInByte; set => this._provisionedLocalStorageInByte = value; } + + /// Backing field for property. + private long? _provisionedStorageInByte; + + /// + /// Storage in bytes that has been provisioned on the device including both local and cloud + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? ProvisionedStorageInByte { get => this._provisionedStorageInByte; set => this._provisionedStorageInByte = value; } + + /// Backing field for property. + private long? _totalBackupSizeInByte; + + /// Total size taken up by backups in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? TotalBackupSizeInByte { get => this._totalBackupSizeInByte; set => this._totalBackupSizeInByte = value; } + + /// Backing field for property. + private long? _totalLocalStorageInByte; + + /// Total local storage capacity in device in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? TotalLocalStorageInByte { get => this._totalLocalStorageInByte; set => this._totalLocalStorageInByte = value; } + + /// Backing field for property. + private long? _totalStorageInByte; + + /// Total storage available on the device in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? TotalStorageInByte { get => this._totalStorageInByte; set => this._totalStorageInByte = value; } + + /// Backing field for property. + private long? _usingLocalStorageInByte; + + /// Local Storage that is being currently used in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? UsingLocalStorageInByte { get => this._usingLocalStorageInByte; set => this._usingLocalStorageInByte = value; } + + /// Backing field for property. + private long? _usingStorageInByte; + + /// Storage that is being currently used in bytes including both local and cloud + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? UsingStorageInByte { get => this._usingStorageInByte; set => this._usingStorageInByte = value; } + + /// Creates an new instance. + public DeviceDetails() + { + + } + } + /// Class containing more granular details about the device + public partial interface IDeviceDetails : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Local pending storage available on the device in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Local pending storage available on the device in bytes", + SerializedName = @"availableLocalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? AvailableLocalStorageInByte { get; set; } + /// Total pending available storage on the device in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total pending available storage on the device in bytes", + SerializedName = @"availableStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? AvailableStorageInByte { get; set; } + /// + /// Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes + /// on IscsiServer) + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes on IscsiServer)", + SerializedName = @"endpointCount", + PossibleTypes = new [] { typeof(int) })] + int? EndpointCount { get; set; } + /// Storage in bytes that has been provisioned locally on the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage in bytes that has been provisioned locally on the device", + SerializedName = @"provisionedLocalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? ProvisionedLocalStorageInByte { get; set; } + /// + /// Storage in bytes that has been provisioned on the device including both local and cloud + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage in bytes that has been provisioned on the device including both local and cloud", + SerializedName = @"provisionedStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? ProvisionedStorageInByte { get; set; } + /// Total size taken up by backups in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total size taken up by backups in bytes", + SerializedName = @"totalBackupSizeInBytes", + PossibleTypes = new [] { typeof(long) })] + long? TotalBackupSizeInByte { get; set; } + /// Total local storage capacity in device in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total local storage capacity in device in bytes.", + SerializedName = @"totalLocalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? TotalLocalStorageInByte { get; set; } + /// Total storage available on the device in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total storage available on the device in bytes.", + SerializedName = @"totalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? TotalStorageInByte { get; set; } + /// Local Storage that is being currently used in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Local Storage that is being currently used in bytes", + SerializedName = @"usingLocalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? UsingLocalStorageInByte { get; set; } + /// Storage that is being currently used in bytes including both local and cloud + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage that is being currently used in bytes including both local and cloud", + SerializedName = @"usingStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? UsingStorageInByte { get; set; } + + } + /// Class containing more granular details about the device + internal partial interface IDeviceDetailsInternal + + { + /// Local pending storage available on the device in bytes + long? AvailableLocalStorageInByte { get; set; } + /// Total pending available storage on the device in bytes + long? AvailableStorageInByte { get; set; } + /// + /// Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes + /// on IscsiServer) + /// + int? EndpointCount { get; set; } + /// Storage in bytes that has been provisioned locally on the device + long? ProvisionedLocalStorageInByte { get; set; } + /// + /// Storage in bytes that has been provisioned on the device including both local and cloud + /// + long? ProvisionedStorageInByte { get; set; } + /// Total size taken up by backups in bytes + long? TotalBackupSizeInByte { get; set; } + /// Total local storage capacity in device in bytes. + long? TotalLocalStorageInByte { get; set; } + /// Total storage available on the device in bytes. + long? TotalStorageInByte { get; set; } + /// Local Storage that is being currently used in bytes + long? UsingLocalStorageInByte { get; set; } + /// Storage that is being currently used in bytes including both local and cloud + long? UsingStorageInByte { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceDetails.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceDetails.json.cs new file mode 100644 index 000000000000..705556193282 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceDetails.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class containing more granular details about the device + public partial class DeviceDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal DeviceDetails(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_endpointCount = If( json?.PropertyT("endpointCount"), out var __jsonEndpointCount) ? (int?)__jsonEndpointCount : EndpointCount;} + {_totalStorageInByte = If( json?.PropertyT("totalStorageInBytes"), out var __jsonTotalStorageInBytes) ? (long?)__jsonTotalStorageInBytes : TotalStorageInByte;} + {_totalLocalStorageInByte = If( json?.PropertyT("totalLocalStorageInBytes"), out var __jsonTotalLocalStorageInBytes) ? (long?)__jsonTotalLocalStorageInBytes : TotalLocalStorageInByte;} + {_provisionedStorageInByte = If( json?.PropertyT("provisionedStorageInBytes"), out var __jsonProvisionedStorageInBytes) ? (long?)__jsonProvisionedStorageInBytes : ProvisionedStorageInByte;} + {_provisionedLocalStorageInByte = If( json?.PropertyT("provisionedLocalStorageInBytes"), out var __jsonProvisionedLocalStorageInBytes) ? (long?)__jsonProvisionedLocalStorageInBytes : ProvisionedLocalStorageInByte;} + {_usingStorageInByte = If( json?.PropertyT("usingStorageInBytes"), out var __jsonUsingStorageInBytes) ? (long?)__jsonUsingStorageInBytes : UsingStorageInByte;} + {_usingLocalStorageInByte = If( json?.PropertyT("usingLocalStorageInBytes"), out var __jsonUsingLocalStorageInBytes) ? (long?)__jsonUsingLocalStorageInBytes : UsingLocalStorageInByte;} + {_totalBackupSizeInByte = If( json?.PropertyT("totalBackupSizeInBytes"), out var __jsonTotalBackupSizeInBytes) ? (long?)__jsonTotalBackupSizeInBytes : TotalBackupSizeInByte;} + {_availableStorageInByte = If( json?.PropertyT("availableStorageInBytes"), out var __jsonAvailableStorageInBytes) ? (long?)__jsonAvailableStorageInBytes : AvailableStorageInByte;} + {_availableLocalStorageInByte = If( json?.PropertyT("availableLocalStorageInBytes"), out var __jsonAvailableLocalStorageInBytes) ? (long?)__jsonAvailableLocalStorageInBytes : AvailableLocalStorageInByte;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new DeviceDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._endpointCount ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._endpointCount) : null, "endpointCount" ,container.Add ); + AddIf( null != this._totalStorageInByte ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._totalStorageInByte) : null, "totalStorageInBytes" ,container.Add ); + AddIf( null != this._totalLocalStorageInByte ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._totalLocalStorageInByte) : null, "totalLocalStorageInBytes" ,container.Add ); + AddIf( null != this._provisionedStorageInByte ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._provisionedStorageInByte) : null, "provisionedStorageInBytes" ,container.Add ); + AddIf( null != this._provisionedLocalStorageInByte ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._provisionedLocalStorageInByte) : null, "provisionedLocalStorageInBytes" ,container.Add ); + AddIf( null != this._usingStorageInByte ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._usingStorageInByte) : null, "usingStorageInBytes" ,container.Add ); + AddIf( null != this._usingLocalStorageInByte ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._usingLocalStorageInByte) : null, "usingLocalStorageInBytes" ,container.Add ); + AddIf( null != this._totalBackupSizeInByte ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._totalBackupSizeInByte) : null, "totalBackupSizeInBytes" ,container.Add ); + AddIf( null != this._availableStorageInByte ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._availableStorageInByte) : null, "availableStorageInBytes" ,container.Add ); + AddIf( null != this._availableLocalStorageInByte ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._availableLocalStorageInByte) : null, "availableLocalStorageInBytes" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceList.PowerShell.cs new file mode 100644 index 000000000000..e08e060e93af --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceList.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Collection of Devices + [System.ComponentModel.TypeConverter(typeof(DeviceListTypeConverter))] + public partial class DeviceList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeviceList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeviceList(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeviceList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeviceList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of Devices + [System.ComponentModel.TypeConverter(typeof(DeviceListTypeConverter))] + public partial interface IDeviceList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceList.TypeConverter.cs new file mode 100644 index 000000000000..aa83c7d3a923 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceList.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeviceListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeviceList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeviceList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeviceList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceList.cs new file mode 100644 index 000000000000..23429660eb05 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of Devices + public partial class DeviceList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public DeviceList() + { + + } + } + /// Collection of Devices + public partial interface IDeviceList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice[] Value { get; set; } + + } + /// Collection of Devices + internal partial interface IDeviceListInternal + + { + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceList.json.cs new file mode 100644 index 000000000000..5e36e51120da --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of Devices + public partial class DeviceList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal DeviceList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Device.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new DeviceList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DevicePatch.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DevicePatch.PowerShell.cs new file mode 100644 index 000000000000..3683300a0114 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DevicePatch.PowerShell.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" + /// + [System.ComponentModel.TypeConverter(typeof(DevicePatchTypeConverter))] + public partial class DevicePatch + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DevicePatch(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DevicePatch(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DevicePatch(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DeviceDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatchInternal)this).DeviceDescription = (string) content.GetValueForProperty("DeviceDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatchInternal)this).DeviceDescription, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DevicePatch(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DeviceDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatchInternal)this).DeviceDescription = (string) content.GetValueForProperty("DeviceDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatchInternal)this).DeviceDescription, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" + [System.ComponentModel.TypeConverter(typeof(DevicePatchTypeConverter))] + public partial interface IDevicePatch + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DevicePatch.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DevicePatch.TypeConverter.cs new file mode 100644 index 000000000000..4d8815f3fcb2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DevicePatch.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DevicePatchTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DevicePatch.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DevicePatch.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DevicePatch.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DevicePatch.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DevicePatch.cs new file mode 100644 index 000000000000..071f799dd03b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DevicePatch.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// + /// Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" + /// + public partial class DevicePatch : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatchInternal + { + + /// Backing field for property. + private string _deviceDescription; + + /// Short description given for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string DeviceDescription { get => this._deviceDescription; set => this._deviceDescription = value; } + + /// Creates an new instance. + public DevicePatch() + { + + } + } + /// Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" + public partial interface IDevicePatch : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Short description given for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Short description given for the device", + SerializedName = @"deviceDescription", + PossibleTypes = new [] { typeof(string) })] + string DeviceDescription { get; set; } + + } + /// Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" + internal partial interface IDevicePatchInternal + + { + /// Short description given for the device + string DeviceDescription { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DevicePatch.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DevicePatch.json.cs new file mode 100644 index 000000000000..530792f61cef --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DevicePatch.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// + /// Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" + /// + public partial class DevicePatch + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal DevicePatch(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_deviceDescription = If( json?.PropertyT("deviceDescription"), out var __jsonDeviceDescription) ? (string)__jsonDeviceDescription : (string)DeviceDescription;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new DevicePatch(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._deviceDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._deviceDescription.ToString()) : null, "deviceDescription" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceProperties.PowerShell.cs new file mode 100644 index 000000000000..67486849968f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceProperties.PowerShell.cs @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Encases all the properties of the Device + [System.ComponentModel.TypeConverter(typeof(DevicePropertiesTypeConverter))] + public partial class DeviceProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeviceProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeviceProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeviceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ActivationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).ActivationTime = (global::System.DateTime?) content.GetValueForProperty("ActivationTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).ActivationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AllowedDeviceOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).AllowedDeviceOperation = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation[]) content.GetValueForProperty("AllowedDeviceOperation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).AllowedDeviceOperation, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation.CreateFrom)); + } + if (content.Contains("Culture")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Culture = (string) content.GetValueForProperty("Culture",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Culture, global::System.Convert.ToString); + } + if (content.Contains("DeviceCapability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceCapability = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities[]) content.GetValueForProperty("DeviceCapability",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceCapability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities.CreateFrom)); + } + if (content.Contains("DeviceDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceDescription = (string) content.GetValueForProperty("DeviceDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceDescription, global::System.Convert.ToString); + } + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("DeviceSoftwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceSoftwareVersion = (string) content.GetValueForProperty("DeviceSoftwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceSoftwareVersion, global::System.Convert.ToString); + } + if (content.Contains("FriendlySoftwareName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).FriendlySoftwareName = (string) content.GetValueForProperty("FriendlySoftwareName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).FriendlySoftwareName, global::System.Convert.ToString); + } + if (content.Contains("DeviceConfigurationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceConfigurationStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus?) content.GetValueForProperty("DeviceConfigurationStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceConfigurationStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus.CreateFrom); + } + if (content.Contains("ModelDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).ModelDescription = (string) content.GetValueForProperty("ModelDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).ModelDescription, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType.CreateFrom); + } + if (content.Contains("DetailEndpointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailEndpointCount = (int?) content.GetValueForProperty("DetailEndpointCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailEndpointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DetailTotalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailTotalStorageInByte = (long?) content.GetValueForProperty("DetailTotalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailTotalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailTotalLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailTotalLocalStorageInByte = (long?) content.GetValueForProperty("DetailTotalLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailTotalLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailProvisionedStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailProvisionedStorageInByte = (long?) content.GetValueForProperty("DetailProvisionedStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailProvisionedStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailProvisionedLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailProvisionedLocalStorageInByte = (long?) content.GetValueForProperty("DetailProvisionedLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailProvisionedLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailUsingStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailUsingStorageInByte = (long?) content.GetValueForProperty("DetailUsingStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailUsingStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailUsingLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailUsingLocalStorageInByte = (long?) content.GetValueForProperty("DetailUsingLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailUsingLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailTotalBackupSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailTotalBackupSizeInByte = (long?) content.GetValueForProperty("DetailTotalBackupSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailTotalBackupSizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailAvailableStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailAvailableStorageInByte = (long?) content.GetValueForProperty("DetailAvailableStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailAvailableStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailAvailableLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailAvailableLocalStorageInByte = (long?) content.GetValueForProperty("DetailAvailableLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailAvailableLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeviceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ActivationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).ActivationTime = (global::System.DateTime?) content.GetValueForProperty("ActivationTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).ActivationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AllowedDeviceOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).AllowedDeviceOperation = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation[]) content.GetValueForProperty("AllowedDeviceOperation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).AllowedDeviceOperation, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation.CreateFrom)); + } + if (content.Contains("Culture")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Culture = (string) content.GetValueForProperty("Culture",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Culture, global::System.Convert.ToString); + } + if (content.Contains("DeviceCapability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceCapability = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities[]) content.GetValueForProperty("DeviceCapability",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceCapability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities.CreateFrom)); + } + if (content.Contains("DeviceDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceDescription = (string) content.GetValueForProperty("DeviceDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceDescription, global::System.Convert.ToString); + } + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("DeviceSoftwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceSoftwareVersion = (string) content.GetValueForProperty("DeviceSoftwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceSoftwareVersion, global::System.Convert.ToString); + } + if (content.Contains("FriendlySoftwareName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).FriendlySoftwareName = (string) content.GetValueForProperty("FriendlySoftwareName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).FriendlySoftwareName, global::System.Convert.ToString); + } + if (content.Contains("DeviceConfigurationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceConfigurationStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus?) content.GetValueForProperty("DeviceConfigurationStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DeviceConfigurationStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus.CreateFrom); + } + if (content.Contains("ModelDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).ModelDescription = (string) content.GetValueForProperty("ModelDescription",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).ModelDescription, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType.CreateFrom); + } + if (content.Contains("DetailEndpointCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailEndpointCount = (int?) content.GetValueForProperty("DetailEndpointCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailEndpointCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DetailTotalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailTotalStorageInByte = (long?) content.GetValueForProperty("DetailTotalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailTotalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailTotalLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailTotalLocalStorageInByte = (long?) content.GetValueForProperty("DetailTotalLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailTotalLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailProvisionedStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailProvisionedStorageInByte = (long?) content.GetValueForProperty("DetailProvisionedStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailProvisionedStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailProvisionedLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailProvisionedLocalStorageInByte = (long?) content.GetValueForProperty("DetailProvisionedLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailProvisionedLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailUsingStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailUsingStorageInByte = (long?) content.GetValueForProperty("DetailUsingStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailUsingStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailUsingLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailUsingLocalStorageInByte = (long?) content.GetValueForProperty("DetailUsingLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailUsingLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailTotalBackupSizeInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailTotalBackupSizeInByte = (long?) content.GetValueForProperty("DetailTotalBackupSizeInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailTotalBackupSizeInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailAvailableStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailAvailableStorageInByte = (long?) content.GetValueForProperty("DetailAvailableStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailAvailableStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailAvailableLocalStorageInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailAvailableLocalStorageInByte = (long?) content.GetValueForProperty("DetailAvailableLocalStorageInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal)this).DetailAvailableLocalStorageInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Encases all the properties of the Device + [System.ComponentModel.TypeConverter(typeof(DevicePropertiesTypeConverter))] + public partial interface IDeviceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceProperties.TypeConverter.cs new file mode 100644 index 000000000000..dd2aa30c8bd4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DevicePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeviceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeviceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeviceProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceProperties.cs new file mode 100644 index 000000000000..fd8c82e342be --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceProperties.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Encases all the properties of the Device + public partial class DeviceProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime? _activationTime; + + /// The UTC time at which the device was activated + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? ActivationTime { get => this._activationTime; set => this._activationTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation[] _allowedDeviceOperation; + + /// Operations that are allowed on the device based on its current state + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation[] AllowedDeviceOperation { get => this._allowedDeviceOperation; set => this._allowedDeviceOperation = value; } + + /// Backing field for property. + private string _culture; + + /// Language culture setting on the device. For eg: "en-US" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Culture { get => this._culture; set => this._culture = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails _detail; + + /// + /// subclass containing more storage-related information about the device. This field will be populated only if the get call + /// is made with $expand = details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails Detail { get => (this._detail = this._detail ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceDetails()); set => this._detail = value; } + + /// Local pending storage available on the device in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailAvailableLocalStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).AvailableLocalStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).AvailableLocalStorageInByte = value ?? default(long); } + + /// Total pending available storage on the device in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailAvailableStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).AvailableStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).AvailableStorageInByte = value ?? default(long); } + + /// + /// Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes + /// on IscsiServer) + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? DetailEndpointCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).EndpointCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).EndpointCount = value ?? default(int); } + + /// Storage in bytes that has been provisioned locally on the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailProvisionedLocalStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).ProvisionedLocalStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).ProvisionedLocalStorageInByte = value ?? default(long); } + + /// + /// Storage in bytes that has been provisioned on the device including both local and cloud + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailProvisionedStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).ProvisionedStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).ProvisionedStorageInByte = value ?? default(long); } + + /// Total size taken up by backups in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailTotalBackupSizeInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).TotalBackupSizeInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).TotalBackupSizeInByte = value ?? default(long); } + + /// Total local storage capacity in device in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailTotalLocalStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).TotalLocalStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).TotalLocalStorageInByte = value ?? default(long); } + + /// Total storage available on the device in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailTotalStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).TotalStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).TotalStorageInByte = value ?? default(long); } + + /// Local Storage that is being currently used in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailUsingLocalStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).UsingLocalStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).UsingLocalStorageInByte = value ?? default(long); } + + /// Storage that is being currently used in bytes including both local and cloud + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? DetailUsingStorageInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).UsingStorageInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetailsInternal)Detail).UsingStorageInByte = value ?? default(long); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities[] _deviceCapability; + + /// Device can be configured either as FileServer or IscsiServer + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities[] DeviceCapability { get => this._deviceCapability; set => this._deviceCapability = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus? _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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus? DeviceConfigurationStatus { get => this._deviceConfigurationStatus; set => this._deviceConfigurationStatus = value; } + + /// Backing field for property. + private string _deviceDescription; + + /// Short description given for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string DeviceDescription { get => this._deviceDescription; set => this._deviceDescription = value; } + + /// Backing field for property. + private string _deviceSoftwareVersion; + + /// Version number of the software running on the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string DeviceSoftwareVersion { get => this._deviceSoftwareVersion; set => this._deviceSoftwareVersion = value; } + + /// Backing field for property. + private string _domainName; + + /// Fully qualified name of the domain to which the device is attached + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _friendlySoftwareName; + + /// Friendly name for the software version + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string FriendlySoftwareName { get => this._friendlySoftwareName; set => this._friendlySoftwareName = value; } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePropertiesInternal.Detail { get => (this._detail = this._detail ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceDetails()); set { {_detail = value;} } } + + /// Backing field for property. + private string _modelDescription; + + /// Name of the device model + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ModelDescription { get => this._modelDescription; set => this._modelDescription = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus? _status; + + /// Current status of the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus? Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType? _type; + + /// Type of the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public DeviceProperties() + { + + } + } + /// Encases all the properties of the Device + public partial interface IDeviceProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The UTC time at which the device was activated + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The UTC time at which the device was activated", + SerializedName = @"activationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ActivationTime { get; set; } + /// Operations that are allowed on the device based on its current state + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operations that are allowed on the device based on its current state", + SerializedName = @"allowedDeviceOperations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation[] AllowedDeviceOperation { get; set; } + /// Language culture setting on the device. For eg: "en-US" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Language culture setting on the device. For eg: ""en-US""", + SerializedName = @"culture", + PossibleTypes = new [] { typeof(string) })] + string Culture { get; set; } + /// Local pending storage available on the device in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Local pending storage available on the device in bytes", + SerializedName = @"availableLocalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailAvailableLocalStorageInByte { get; set; } + /// Total pending available storage on the device in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total pending available storage on the device in bytes", + SerializedName = @"availableStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailAvailableStorageInByte { get; set; } + /// + /// Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes + /// on IscsiServer) + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes on IscsiServer)", + SerializedName = @"endpointCount", + PossibleTypes = new [] { typeof(int) })] + int? DetailEndpointCount { get; set; } + /// Storage in bytes that has been provisioned locally on the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage in bytes that has been provisioned locally on the device", + SerializedName = @"provisionedLocalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailProvisionedLocalStorageInByte { get; set; } + /// + /// Storage in bytes that has been provisioned on the device including both local and cloud + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage in bytes that has been provisioned on the device including both local and cloud", + SerializedName = @"provisionedStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailProvisionedStorageInByte { get; set; } + /// Total size taken up by backups in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total size taken up by backups in bytes", + SerializedName = @"totalBackupSizeInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailTotalBackupSizeInByte { get; set; } + /// Total local storage capacity in device in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total local storage capacity in device in bytes.", + SerializedName = @"totalLocalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailTotalLocalStorageInByte { get; set; } + /// Total storage available on the device in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total storage available on the device in bytes.", + SerializedName = @"totalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailTotalStorageInByte { get; set; } + /// Local Storage that is being currently used in bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Local Storage that is being currently used in bytes", + SerializedName = @"usingLocalStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailUsingLocalStorageInByte { get; set; } + /// Storage that is being currently used in bytes including both local and cloud + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Storage that is being currently used in bytes including both local and cloud", + SerializedName = @"usingStorageInBytes", + PossibleTypes = new [] { typeof(long) })] + long? DetailUsingStorageInByte { get; set; } + /// Device can be configured either as FileServer or IscsiServer + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Device can be configured either as FileServer or IscsiServer", + SerializedName = @"deviceCapabilities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities[] DeviceCapability { get; set; } + /// + /// "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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"""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", + SerializedName = @"deviceConfigurationStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus? DeviceConfigurationStatus { get; set; } + /// Short description given for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Short description given for the device", + SerializedName = @"deviceDescription", + PossibleTypes = new [] { typeof(string) })] + string DeviceDescription { get; set; } + /// Version number of the software running on the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version number of the software running on the device", + SerializedName = @"deviceSoftwareVersion", + PossibleTypes = new [] { typeof(string) })] + string DeviceSoftwareVersion { get; set; } + /// Fully qualified name of the domain to which the device is attached + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified name of the domain to which the device is attached", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string DomainName { get; set; } + /// Friendly name for the software version + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Friendly name for the software version", + SerializedName = @"friendlySoftwareName", + PossibleTypes = new [] { typeof(string) })] + string FriendlySoftwareName { get; set; } + /// Name of the device model + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the device model", + SerializedName = @"modelDescription", + PossibleTypes = new [] { typeof(string) })] + string ModelDescription { get; set; } + /// Current status of the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Current status of the device", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus? Status { get; set; } + /// Type of the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the device", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType? Type { get; set; } + + } + /// Encases all the properties of the Device + internal partial interface IDevicePropertiesInternal + + { + /// The UTC time at which the device was activated + global::System.DateTime? ActivationTime { get; set; } + /// Operations that are allowed on the device based on its current state + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation[] AllowedDeviceOperation { get; set; } + /// Language culture setting on the device. For eg: "en-US" + string Culture { get; set; } + /// + /// subclass containing more storage-related information about the device. This field will be populated only if the get call + /// is made with $expand = details. + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceDetails Detail { get; set; } + /// Local pending storage available on the device in bytes + long? DetailAvailableLocalStorageInByte { get; set; } + /// Total pending available storage on the device in bytes + long? DetailAvailableStorageInByte { get; set; } + /// + /// Total number of endpoints that are currently on the device ( i.e. number of shares on FileServer or number of volumes + /// on IscsiServer) + /// + int? DetailEndpointCount { get; set; } + /// Storage in bytes that has been provisioned locally on the device + long? DetailProvisionedLocalStorageInByte { get; set; } + /// + /// Storage in bytes that has been provisioned on the device including both local and cloud + /// + long? DetailProvisionedStorageInByte { get; set; } + /// Total size taken up by backups in bytes + long? DetailTotalBackupSizeInByte { get; set; } + /// Total local storage capacity in device in bytes. + long? DetailTotalLocalStorageInByte { get; set; } + /// Total storage available on the device in bytes. + long? DetailTotalStorageInByte { get; set; } + /// Local Storage that is being currently used in bytes + long? DetailUsingLocalStorageInByte { get; set; } + /// Storage that is being currently used in bytes including both local and cloud + long? DetailUsingStorageInByte { get; set; } + /// Device can be configured either as FileServer or IscsiServer + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities[] DeviceCapability { get; set; } + /// + /// "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 + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus? DeviceConfigurationStatus { get; set; } + /// Short description given for the device + string DeviceDescription { get; set; } + /// Version number of the software running on the device + string DeviceSoftwareVersion { get; set; } + /// Fully qualified name of the domain to which the device is attached + string DomainName { get; set; } + /// Friendly name for the software version + string FriendlySoftwareName { get; set; } + /// Name of the device model + string ModelDescription { get; set; } + /// Current status of the device + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus? Status { get; set; } + /// Type of the device + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceProperties.json.cs new file mode 100644 index 000000000000..c37850185f11 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/DeviceProperties.json.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Encases all the properties of the Device + public partial class DeviceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal DeviceProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceDetails.FromJson(__jsonDetails) : Detail;} + {_activationTime = If( json?.PropertyT("activationTime"), out var __jsonActivationTime) ? global::System.DateTime.TryParse((string)__jsonActivationTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonActivationTimeValue) ? __jsonActivationTimeValue : ActivationTime : ActivationTime;} + {_allowedDeviceOperation = If( json?.PropertyT("allowedDeviceOperations"), out var __jsonAllowedDeviceOperations) ? If( __jsonAllowedDeviceOperations as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation) (__u is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation)""))) ))() : null : AllowedDeviceOperation;} + {_culture = If( json?.PropertyT("culture"), out var __jsonCulture) ? (string)__jsonCulture : (string)Culture;} + {_deviceCapability = If( json?.PropertyT("deviceCapabilities"), out var __jsonDeviceCapabilities) ? If( __jsonDeviceCapabilities as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities) (__p is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString __o ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities)(__o.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities)""))) ))() : null : DeviceCapability;} + {_deviceDescription = If( json?.PropertyT("deviceDescription"), out var __jsonDeviceDescription) ? (string)__jsonDeviceDescription : (string)DeviceDescription;} + {_domainName = If( json?.PropertyT("domainName"), out var __jsonDomainName) ? (string)__jsonDomainName : (string)DomainName;} + {_deviceSoftwareVersion = If( json?.PropertyT("deviceSoftwareVersion"), out var __jsonDeviceSoftwareVersion) ? (string)__jsonDeviceSoftwareVersion : (string)DeviceSoftwareVersion;} + {_friendlySoftwareName = If( json?.PropertyT("friendlySoftwareName"), out var __jsonFriendlySoftwareName) ? (string)__jsonFriendlySoftwareName : (string)FriendlySoftwareName;} + {_deviceConfigurationStatus = If( json?.PropertyT("deviceConfigurationStatus"), out var __jsonDeviceConfigurationStatus) ? (string)__jsonDeviceConfigurationStatus : (string)DeviceConfigurationStatus;} + {_modelDescription = If( json?.PropertyT("modelDescription"), out var __jsonModelDescription) ? (string)__jsonModelDescription : (string)ModelDescription;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new DeviceProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._detail ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._detail.ToJson(null,serializationMode) : null, "details" ,container.Add ); + AddIf( null != this._activationTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._activationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "activationTime" ,container.Add ); + if (null != this._allowedDeviceOperation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._allowedDeviceOperation ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("allowedDeviceOperations",__w); + } + AddIf( null != (((object)this._culture)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._culture.ToString()) : null, "culture" ,container.Add ); + if (null != this._deviceCapability) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __s in this._deviceCapability ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("deviceCapabilities",__r); + } + AddIf( null != (((object)this._deviceDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._deviceDescription.ToString()) : null, "deviceDescription" ,container.Add ); + AddIf( null != (((object)this._domainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._domainName.ToString()) : null, "domainName" ,container.Add ); + AddIf( null != (((object)this._deviceSoftwareVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._deviceSoftwareVersion.ToString()) : null, "deviceSoftwareVersion" ,container.Add ); + AddIf( null != (((object)this._friendlySoftwareName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._friendlySoftwareName.ToString()) : null, "friendlySoftwareName" ,container.Add ); + AddIf( null != (((object)this._deviceConfigurationStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._deviceConfigurationStatus.ToString()) : null, "deviceConfigurationStatus" ,container.Add ); + AddIf( null != (((object)this._modelDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._modelDescription.ToString()) : null, "modelDescription" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettings.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettings.PowerShell.cs new file mode 100644 index 000000000000..09266d604b75 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettings.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The EncryptionSettings + [System.ComponentModel.TypeConverter(typeof(EncryptionSettingsTypeConverter))] + public partial class EncryptionSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EncryptionSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EncryptionSettings(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EncryptionSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.EncryptionSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus.CreateFrom); + } + if (content.Contains("KeyRolloverStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal)this).KeyRolloverStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus) content.GetValueForProperty("KeyRolloverStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal)this).KeyRolloverStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EncryptionSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.EncryptionSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus.CreateFrom); + } + if (content.Contains("KeyRolloverStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal)this).KeyRolloverStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus) content.GetValueForProperty("KeyRolloverStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal)this).KeyRolloverStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The EncryptionSettings + [System.ComponentModel.TypeConverter(typeof(EncryptionSettingsTypeConverter))] + public partial interface IEncryptionSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettings.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettings.TypeConverter.cs new file mode 100644 index 000000000000..f28b33834f34 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettings.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EncryptionSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EncryptionSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EncryptionSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EncryptionSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettings.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettings.cs new file mode 100644 index 000000000000..b345076e71ca --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettings.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The EncryptionSettings + public partial class EncryptionSettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The encryption status which indicates if encryption is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus EncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsPropertiesInternal)Property).EncryptionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsPropertiesInternal)Property).EncryptionStatus = value ; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// + /// The key rollover status which indicates if key rollover is required or not. If secrets encryption has been upgraded, then + /// it requires key rollover. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus KeyRolloverStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsPropertiesInternal)Property).KeyRolloverStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsPropertiesInternal)Property).KeyRolloverStatus = value ; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.EncryptionSettingsProperties()); set { {_property = value;} } } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties _property; + + /// Properties of the EncryptionSettings. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.EncryptionSettingsProperties()); set => this._property = value; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public EncryptionSettings() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The EncryptionSettings + public partial interface IEncryptionSettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// The encryption status which indicates if encryption is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The encryption status which indicates if encryption is enabled or not.", + SerializedName = @"encryptionStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus EncryptionStatus { get; set; } + /// + /// The key rollover status which indicates if key rollover is required or not. If secrets encryption has been upgraded, then + /// it requires key rollover. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The key rollover status which indicates if key rollover is required or not. If secrets encryption has been upgraded, then it requires key rollover.", + SerializedName = @"keyRolloverStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus KeyRolloverStatus { get; set; } + + } + /// The EncryptionSettings + internal partial interface IEncryptionSettingsInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The encryption status which indicates if encryption is enabled or not. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus EncryptionStatus { get; set; } + /// + /// The key rollover status which indicates if key rollover is required or not. If secrets encryption has been upgraded, then + /// it requires key rollover. + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus KeyRolloverStatus { get; set; } + /// Properties of the EncryptionSettings. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettings.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettings.json.cs new file mode 100644 index 000000000000..7ff3459f664a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettings.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The EncryptionSettings + public partial class EncryptionSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal EncryptionSettings(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.EncryptionSettingsProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new EncryptionSettings(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettingsProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettingsProperties.PowerShell.cs new file mode 100644 index 000000000000..4cb2a3251839 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettingsProperties.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The properties of EncryptionSettings + [System.ComponentModel.TypeConverter(typeof(EncryptionSettingsPropertiesTypeConverter))] + public partial class EncryptionSettingsProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EncryptionSettingsProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EncryptionSettingsProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EncryptionSettingsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsPropertiesInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsPropertiesInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus.CreateFrom); + } + if (content.Contains("KeyRolloverStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsPropertiesInternal)this).KeyRolloverStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus) content.GetValueForProperty("KeyRolloverStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsPropertiesInternal)this).KeyRolloverStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EncryptionSettingsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsPropertiesInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsPropertiesInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus.CreateFrom); + } + if (content.Contains("KeyRolloverStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsPropertiesInternal)this).KeyRolloverStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus) content.GetValueForProperty("KeyRolloverStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsPropertiesInternal)this).KeyRolloverStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of EncryptionSettings + [System.ComponentModel.TypeConverter(typeof(EncryptionSettingsPropertiesTypeConverter))] + public partial interface IEncryptionSettingsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettingsProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettingsProperties.TypeConverter.cs new file mode 100644 index 000000000000..066954ab4d4a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettingsProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EncryptionSettingsPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EncryptionSettingsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EncryptionSettingsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EncryptionSettingsProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettingsProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettingsProperties.cs new file mode 100644 index 000000000000..df346bd9db4a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettingsProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The properties of EncryptionSettings + public partial class EncryptionSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus _encryptionStatus; + + /// The encryption status which indicates if encryption is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus EncryptionStatus { get => this._encryptionStatus; set => this._encryptionStatus = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus _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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus KeyRolloverStatus { get => this._keyRolloverStatus; set => this._keyRolloverStatus = value; } + + /// Creates an new instance. + public EncryptionSettingsProperties() + { + + } + } + /// The properties of EncryptionSettings + public partial interface IEncryptionSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The encryption status which indicates if encryption is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The encryption status which indicates if encryption is enabled or not.", + SerializedName = @"encryptionStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus EncryptionStatus { get; set; } + /// + /// The key rollover status which indicates if key rollover is required or not. If secrets encryption has been upgraded, then + /// it requires key rollover. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The key rollover status which indicates if key rollover is required or not. If secrets encryption has been upgraded, then it requires key rollover.", + SerializedName = @"keyRolloverStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus KeyRolloverStatus { get; set; } + + } + /// The properties of EncryptionSettings + internal partial interface IEncryptionSettingsPropertiesInternal + + { + /// The encryption status which indicates if encryption is enabled or not. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus EncryptionStatus { get; set; } + /// + /// The key rollover status which indicates if key rollover is required or not. If secrets encryption has been upgraded, then + /// it requires key rollover. + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus KeyRolloverStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettingsProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettingsProperties.json.cs new file mode 100644 index 000000000000..248a04431a15 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/EncryptionSettingsProperties.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The properties of EncryptionSettings + public partial class EncryptionSettingsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal EncryptionSettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_encryptionStatus = If( json?.PropertyT("encryptionStatus"), out var __jsonEncryptionStatus) ? (string)__jsonEncryptionStatus : (string)EncryptionStatus;} + {_keyRolloverStatus = If( json?.PropertyT("keyRolloverStatus"), out var __jsonKeyRolloverStatus) ? (string)__jsonKeyRolloverStatus : (string)KeyRolloverStatus;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new EncryptionSettingsProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._encryptionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._encryptionStatus.ToString()) : null, "encryptionStatus" ,container.Add ); + AddIf( null != (((object)this._keyRolloverStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._keyRolloverStatus.ToString()) : null, "keyRolloverStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Error.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Error.PowerShell.cs new file mode 100644 index 000000000000..c54fb6d7d5c1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Error.PowerShell.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ErrorTypeConverter))] + public partial class Error + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Error(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Error(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Error(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).Message = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).Message, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MessageTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ItemTypeConverter.ConvertFrom)); + } + if (content.Contains("MessageLanguage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).MessageLanguage = (string) content.GetValueForProperty("MessageLanguage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).MessageLanguage, global::System.Convert.ToString); + } + if (content.Contains("MessageValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).MessageValue = (string) content.GetValueForProperty("MessageValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).MessageValue, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Error(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).Message = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).Message, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MessageTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ItemTypeConverter.ConvertFrom)); + } + if (content.Contains("MessageLanguage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).MessageLanguage = (string) content.GetValueForProperty("MessageLanguage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).MessageLanguage, global::System.Convert.ToString); + } + if (content.Contains("MessageValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).MessageValue = (string) content.GetValueForProperty("MessageValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal)this).MessageValue, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ErrorTypeConverter))] + public partial interface IError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Error.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Error.TypeConverter.cs new file mode 100644 index 000000000000..b88e9612724f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Error.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Error.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Error.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Error.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Error.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Error.cs new file mode 100644 index 000000000000..a276aad6c269 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Error.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + public partial class Error : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal + { + + /// Backing field for property. + private string _code; + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage _message; + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage Message { get => (this._message = this._message ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Message()); set => this._message = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string MessageLanguage { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessageInternal)Message).Language; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessageInternal)Message).Language = value ?? null; } + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string MessageValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessageInternal)Message).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessageInternal)Message).Value = value ?? null; } + + /// Internal Acessors for Message + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IErrorInternal.Message { get => (this._message = this._message ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Message()); set { {_message = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem[] _value; + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public Error() + { + + } + } + public partial interface IError : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"language", + PossibleTypes = new [] { typeof(string) })] + string MessageLanguage { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string MessageValue { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"values", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem[] Value { get; set; } + + } + internal partial interface IErrorInternal + + { + string Code { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage Message { get; set; } + + string MessageLanguage { get; set; } + + string MessageValue { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Error.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Error.json.cs new file mode 100644 index 000000000000..e8608a57de24 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Error.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + public partial class Error + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal Error(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Message.FromJson(__jsonMessage) : Message;} + {_code = If( json?.PropertyT("errorCode"), out var __jsonErrorCode) ? (string)__jsonErrorCode : (string)Code;} + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Item.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new Error(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._message ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._message.ToJson(null,serializationMode) : null, "message" ,container.Add ); + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._code.ToString()) : null, "errorCode" ,container.Add ); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FailoverRequest.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FailoverRequest.PowerShell.cs new file mode 100644 index 000000000000..546d74ac1e42 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FailoverRequest.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The Failover request object. + [System.ComponentModel.TypeConverter(typeof(FailoverRequestTypeConverter))] + public partial class FailoverRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FailoverRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FailoverRequest(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FailoverRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AccesspointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).AccesspointId = (string[]) content.GetValueForProperty("AccesspointId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).AccesspointId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).TargetDeviceId = (string) content.GetValueForProperty("TargetDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).TargetDeviceId, global::System.Convert.ToString); + } + if (content.Contains("SkipValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).SkipValidation = (bool?) content.GetValueForProperty("SkipValidation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).SkipValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KeepSourceDevice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).KeepSourceDevice = (bool?) content.GetValueForProperty("KeepSourceDevice",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).KeepSourceDevice, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FailoverRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AccesspointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).AccesspointId = (string[]) content.GetValueForProperty("AccesspointId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).AccesspointId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).TargetDeviceId = (string) content.GetValueForProperty("TargetDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).TargetDeviceId, global::System.Convert.ToString); + } + if (content.Contains("SkipValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).SkipValidation = (bool?) content.GetValueForProperty("SkipValidation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).SkipValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KeepSourceDevice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).KeepSourceDevice = (bool?) content.GetValueForProperty("KeepSourceDevice",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal)this).KeepSourceDevice, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Failover request object. + [System.ComponentModel.TypeConverter(typeof(FailoverRequestTypeConverter))] + public partial interface IFailoverRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FailoverRequest.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FailoverRequest.TypeConverter.cs new file mode 100644 index 000000000000..9df1392b59ae --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FailoverRequest.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FailoverRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FailoverRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FailoverRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FailoverRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FailoverRequest.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FailoverRequest.cs new file mode 100644 index 000000000000..731aeb65a8e9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FailoverRequest.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Failover request object. + public partial class FailoverRequest : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequest, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequestInternal + { + + /// Backing field for property. + private string[] _accesspointId; + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string[] AccesspointId { get => this._accesspointId; set => this._accesspointId = value; } + + /// Backing field for property. + private bool? _keepSourceDevice; + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public bool? KeepSourceDevice { get => this._keepSourceDevice; set => this._keepSourceDevice = value; } + + /// Backing field for property. + private bool? _skipValidation; + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public bool? SkipValidation { get => this._skipValidation; set => this._skipValidation = value; } + + /// Backing field for property. + private string _targetDeviceId; + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string TargetDeviceId { get => this._targetDeviceId; set => this._targetDeviceId = value; } + + /// Creates an new instance. + public FailoverRequest() + { + + } + } + /// The Failover request object. + public partial interface IFailoverRequest : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"accesspointIds", + PossibleTypes = new [] { typeof(string) })] + string[] AccesspointId { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"keepSourceDevice", + PossibleTypes = new [] { typeof(bool) })] + bool? KeepSourceDevice { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"skipValidation", + PossibleTypes = new [] { typeof(bool) })] + bool? SkipValidation { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"targetDeviceId", + PossibleTypes = new [] { typeof(string) })] + string TargetDeviceId { get; set; } + + } + /// The Failover request object. + internal partial interface IFailoverRequestInternal + + { + string[] AccesspointId { get; set; } + + bool? KeepSourceDevice { get; set; } + + bool? SkipValidation { get; set; } + + string TargetDeviceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FailoverRequest.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FailoverRequest.json.cs new file mode 100644 index 000000000000..ba213914c5fa --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FailoverRequest.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Failover request object. + public partial class FailoverRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal FailoverRequest(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_accesspointId = If( json?.PropertyT("accesspointIds"), out var __jsonAccesspointIds) ? If( __jsonAccesspointIds as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AccesspointId;} + {_targetDeviceId = If( json?.PropertyT("targetDeviceId"), out var __jsonTargetDeviceId) ? (string)__jsonTargetDeviceId : (string)TargetDeviceId;} + {_skipValidation = If( json?.PropertyT("skipValidation"), out var __jsonSkipValidation) ? (bool?)__jsonSkipValidation : SkipValidation;} + {_keepSourceDevice = If( json?.PropertyT("keepSourceDevice"), out var __jsonKeepSourceDevice) ? (bool?)__jsonKeepSourceDevice : KeepSourceDevice;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new FailoverRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._accesspointId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._accesspointId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("accesspointIds",__w); + } + AddIf( null != (((object)this._targetDeviceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._targetDeviceId.ToString()) : null, "targetDeviceId" ,container.Add ); + AddIf( null != this._skipValidation ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonBoolean((bool)this._skipValidation) : null, "skipValidation" ,container.Add ); + AddIf( null != this._keepSourceDevice ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonBoolean((bool)this._keepSourceDevice) : null, "keepSourceDevice" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServer.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServer.PowerShell.cs new file mode 100644 index 000000000000..fa57a7ac90e5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServer.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The file server. + [System.ComponentModel.TypeConverter(typeof(FileServerTypeConverter))] + public partial class FileServer + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileServer(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileServer(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileServer(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("StorageDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).StorageDomainId = (string) content.GetValueForProperty("StorageDomainId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).StorageDomainId, global::System.Convert.ToString); + } + if (content.Contains("BackupScheduleGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).BackupScheduleGroupId = (string) content.GetValueForProperty("BackupScheduleGroupId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).BackupScheduleGroupId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileServer(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("StorageDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).StorageDomainId = (string) content.GetValueForProperty("StorageDomainId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).StorageDomainId, global::System.Convert.ToString); + } + if (content.Contains("BackupScheduleGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).BackupScheduleGroupId = (string) content.GetValueForProperty("BackupScheduleGroupId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).BackupScheduleGroupId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The file server. + [System.ComponentModel.TypeConverter(typeof(FileServerTypeConverter))] + public partial interface IFileServer + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServer.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServer.TypeConverter.cs new file mode 100644 index 000000000000..5a4a67e32482 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServer.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileServerTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileServer.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileServer.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileServer.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServer.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServer.cs new file mode 100644 index 000000000000..67bf958c61cc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServer.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The file server. + public partial class FileServer : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The backup policy id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string BackupScheduleGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)Property).BackupScheduleGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)Property).BackupScheduleGroupId = value ; } + + /// The description of the file server + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)Property).Description = value ?? null; } + + /// Domain of the file server + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)Property).DomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)Property).DomainName = value ; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServerProperties()); set { {_property = value;} } } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties _property; + + /// The properties. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServerProperties()); set => this._property = value; } + + /// The storage domain id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string StorageDomainId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)Property).StorageDomainId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)Property).StorageDomainId = value ; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public FileServer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The file server. + public partial interface IFileServer : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// The backup policy id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup policy id.", + SerializedName = @"backupScheduleGroupId", + PossibleTypes = new [] { typeof(string) })] + string BackupScheduleGroupId { get; set; } + /// The description of the file server + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description of the file server", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Domain of the file server + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Domain of the file server", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string DomainName { get; set; } + /// The storage domain id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage domain id.", + SerializedName = @"storageDomainId", + PossibleTypes = new [] { typeof(string) })] + string StorageDomainId { get; set; } + + } + /// The file server. + internal partial interface IFileServerInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The backup policy id. + string BackupScheduleGroupId { get; set; } + /// The description of the file server + string Description { get; set; } + /// Domain of the file server + string DomainName { get; set; } + /// The properties. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties Property { get; set; } + /// The storage domain id. + string StorageDomainId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServer.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServer.json.cs new file mode 100644 index 000000000000..e76099832a88 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServer.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The file server. + public partial class FileServer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal FileServer(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServerProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new FileServer(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerList.PowerShell.cs new file mode 100644 index 000000000000..47f411ab1d03 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerList.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Collection of file servers + [System.ComponentModel.TypeConverter(typeof(FileServerListTypeConverter))] + public partial class FileServerList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileServerList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileServerList(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileServerList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServerTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileServerList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServerTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of file servers + [System.ComponentModel.TypeConverter(typeof(FileServerListTypeConverter))] + public partial interface IFileServerList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerList.TypeConverter.cs new file mode 100644 index 000000000000..5752952f2fa1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileServerListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileServerList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileServerList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileServerList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerList.cs new file mode 100644 index 000000000000..1e8e16cad146 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of file servers + public partial class FileServerList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public FileServerList() + { + + } + } + /// Collection of file servers + public partial interface IFileServerList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer[] Value { get; set; } + + } + /// Collection of file servers + internal partial interface IFileServerListInternal + + { + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerList.json.cs new file mode 100644 index 000000000000..007bb180958a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of file servers + public partial class FileServerList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal FileServerList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServer.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new FileServerList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerProperties.PowerShell.cs new file mode 100644 index 000000000000..ec39a4abf737 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerProperties.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The file server properties. + [System.ComponentModel.TypeConverter(typeof(FileServerPropertiesTypeConverter))] + public partial class FileServerProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileServerProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileServerProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileServerProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("StorageDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).StorageDomainId = (string) content.GetValueForProperty("StorageDomainId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).StorageDomainId, global::System.Convert.ToString); + } + if (content.Contains("BackupScheduleGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).BackupScheduleGroupId = (string) content.GetValueForProperty("BackupScheduleGroupId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).BackupScheduleGroupId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileServerProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("StorageDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).StorageDomainId = (string) content.GetValueForProperty("StorageDomainId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).StorageDomainId, global::System.Convert.ToString); + } + if (content.Contains("BackupScheduleGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).BackupScheduleGroupId = (string) content.GetValueForProperty("BackupScheduleGroupId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).BackupScheduleGroupId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The file server properties. + [System.ComponentModel.TypeConverter(typeof(FileServerPropertiesTypeConverter))] + public partial interface IFileServerProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerProperties.TypeConverter.cs new file mode 100644 index 000000000000..c6995b716427 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileServerPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileServerProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileServerProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileServerProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerProperties.cs new file mode 100644 index 000000000000..345af5e4400b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerProperties.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The file server properties. + public partial class FileServerProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerPropertiesInternal + { + + /// Backing field for property. + private string _backupScheduleGroupId; + + /// The backup policy id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string BackupScheduleGroupId { get => this._backupScheduleGroupId; set => this._backupScheduleGroupId = value; } + + /// Backing field for property. + private string _description; + + /// The description of the file server + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _domainName; + + /// Domain of the file server + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _storageDomainId; + + /// The storage domain id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string StorageDomainId { get => this._storageDomainId; set => this._storageDomainId = value; } + + /// Creates an new instance. + public FileServerProperties() + { + + } + } + /// The file server properties. + public partial interface IFileServerProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The backup policy id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup policy id.", + SerializedName = @"backupScheduleGroupId", + PossibleTypes = new [] { typeof(string) })] + string BackupScheduleGroupId { get; set; } + /// The description of the file server + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description of the file server", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Domain of the file server + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Domain of the file server", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string DomainName { get; set; } + /// The storage domain id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage domain id.", + SerializedName = @"storageDomainId", + PossibleTypes = new [] { typeof(string) })] + string StorageDomainId { get; set; } + + } + /// The file server properties. + internal partial interface IFileServerPropertiesInternal + + { + /// The backup policy id. + string BackupScheduleGroupId { get; set; } + /// The description of the file server + string Description { get; set; } + /// Domain of the file server + string DomainName { get; set; } + /// The storage domain id. + string StorageDomainId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerProperties.json.cs new file mode 100644 index 000000000000..626e8c29484d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileServerProperties.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The file server properties. + public partial class FileServerProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal FileServerProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_domainName = If( json?.PropertyT("domainName"), out var __jsonDomainName) ? (string)__jsonDomainName : (string)DomainName;} + {_storageDomainId = If( json?.PropertyT("storageDomainId"), out var __jsonStorageDomainId) ? (string)__jsonStorageDomainId : (string)StorageDomainId;} + {_backupScheduleGroupId = If( json?.PropertyT("backupScheduleGroupId"), out var __jsonBackupScheduleGroupId) ? (string)__jsonBackupScheduleGroupId : (string)BackupScheduleGroupId;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new FileServerProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._domainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._domainName.ToString()) : null, "domainName" ,container.Add ); + AddIf( null != (((object)this._storageDomainId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._storageDomainId.ToString()) : null, "storageDomainId" ,container.Add ); + AddIf( null != (((object)this._backupScheduleGroupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._backupScheduleGroupId.ToString()) : null, "backupScheduleGroupId" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShare.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShare.PowerShell.cs new file mode 100644 index 000000000000..22bc9052a920 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShare.PowerShell.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The File Share. + [System.ComponentModel.TypeConverter(typeof(FileShareTypeConverter))] + public partial class FileShare + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileShare(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileShare(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileShare(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileSharePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ShareStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).ShareStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) content.GetValueForProperty("ShareStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).ShareStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus.CreateFrom); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("AdminUser")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).AdminUser = (string) content.GetValueForProperty("AdminUser",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).AdminUser, global::System.Convert.ToString); + } + if (content.Contains("ProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).ProvisionedCapacityInByte = (long) content.GetValueForProperty("ProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).ProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).UsedCapacityInByte = (long?) content.GetValueForProperty("UsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).UsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).LocalUsedCapacityInByte = (long?) content.GetValueForProperty("LocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).LocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileShare(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileSharePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ShareStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).ShareStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) content.GetValueForProperty("ShareStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).ShareStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus.CreateFrom); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("AdminUser")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).AdminUser = (string) content.GetValueForProperty("AdminUser",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).AdminUser, global::System.Convert.ToString); + } + if (content.Contains("ProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).ProvisionedCapacityInByte = (long) content.GetValueForProperty("ProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).ProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).UsedCapacityInByte = (long?) content.GetValueForProperty("UsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).UsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).LocalUsedCapacityInByte = (long?) content.GetValueForProperty("LocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal)this).LocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The File Share. + [System.ComponentModel.TypeConverter(typeof(FileShareTypeConverter))] + public partial interface IFileShare + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShare.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShare.TypeConverter.cs new file mode 100644 index 000000000000..20fb6c700840 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShare.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileShareTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileShare.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileShare.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileShare.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShare.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShare.cs new file mode 100644 index 000000000000..e9ce22c7d4e1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShare.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The File Share. + public partial class FileShare : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string AdminUser { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).AdminUser; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).AdminUser = value ; } + + /// The data policy + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).DataPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).DataPolicy = value ; } + + /// Description for file share + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).Description = value ?? null; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// The local used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? LocalUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).LocalUsedCapacityInByte; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for LocalUsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal.LocalUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).LocalUsedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).LocalUsedCapacityInByte = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShareProperties()); set { {_property = value;} } } + + /// Internal Acessors for UsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareInternal.UsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).UsedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).UsedCapacityInByte = value; } + + /// The monitoring status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).MonitoringStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).MonitoringStatus = value ; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties _property; + + /// The properties. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShareProperties()); set => this._property = value; } + + /// The total provisioned capacity in Bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long ProvisionedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).ProvisionedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).ProvisionedCapacityInByte = value ; } + + /// The Share Status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus ShareStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).ShareStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).ShareStatus = value ; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// The used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? UsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)Property).UsedCapacityInByte; } + + /// Creates an new instance. + public FileShare() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The File Share. + public partial interface IFileShare : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\xyz.", + SerializedName = @"adminUser", + PossibleTypes = new [] { typeof(string) })] + string AdminUser { get; set; } + /// The data policy + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The data policy", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get; set; } + /// Description for file share + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description for file share", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The local used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The local used capacity in Bytes.", + SerializedName = @"localUsedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? LocalUsedCapacityInByte { get; } + /// The monitoring status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The monitoring status", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get; set; } + /// The total provisioned capacity in Bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The total provisioned capacity in Bytes", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long ProvisionedCapacityInByte { get; set; } + /// The Share Status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Share Status", + SerializedName = @"shareStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus ShareStatus { get; set; } + /// The used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The used capacity in Bytes.", + SerializedName = @"usedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? UsedCapacityInByte { get; } + + } + /// The File Share. + internal partial interface IFileShareInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + string AdminUser { get; set; } + /// The data policy + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get; set; } + /// Description for file share + string Description { get; set; } + /// The local used capacity in Bytes. + long? LocalUsedCapacityInByte { get; set; } + /// The monitoring status + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get; set; } + /// The properties. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties Property { get; set; } + /// The total provisioned capacity in Bytes + long ProvisionedCapacityInByte { get; set; } + /// The Share Status + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus ShareStatus { get; set; } + /// The used capacity in Bytes. + long? UsedCapacityInByte { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShare.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShare.json.cs new file mode 100644 index 000000000000..0d7ee6f7ac8a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShare.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The File Share. + public partial class FileShare + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal FileShare(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShareProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new FileShare(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareList.PowerShell.cs new file mode 100644 index 000000000000..7d1b438b2c83 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareList.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Collection of file shares + [System.ComponentModel.TypeConverter(typeof(FileShareListTypeConverter))] + public partial class FileShareList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileShareList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileShareList(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileShareList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShareTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileShareList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShareTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of file shares + [System.ComponentModel.TypeConverter(typeof(FileShareListTypeConverter))] + public partial interface IFileShareList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareList.TypeConverter.cs new file mode 100644 index 000000000000..ac8aaf043626 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileShareListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileShareList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileShareList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileShareList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareList.cs new file mode 100644 index 000000000000..a655b03be31d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of file shares + public partial class FileShareList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public FileShareList() + { + + } + } + /// Collection of file shares + public partial interface IFileShareList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare[] Value { get; set; } + + } + /// Collection of file shares + internal partial interface IFileShareListInternal + + { + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareList.json.cs new file mode 100644 index 000000000000..e7e9ab36319d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of file shares + public partial class FileShareList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal FileShareList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShare.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new FileShareList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareProperties.PowerShell.cs new file mode 100644 index 000000000000..caf0849be4f8 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareProperties.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The File Share. + [System.ComponentModel.TypeConverter(typeof(FileSharePropertiesTypeConverter))] + public partial class FileShareProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileShareProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileShareProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileShareProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ShareStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).ShareStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) content.GetValueForProperty("ShareStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).ShareStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus.CreateFrom); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("AdminUser")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).AdminUser = (string) content.GetValueForProperty("AdminUser",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).AdminUser, global::System.Convert.ToString); + } + if (content.Contains("ProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).ProvisionedCapacityInByte = (long) content.GetValueForProperty("ProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).ProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).UsedCapacityInByte = (long?) content.GetValueForProperty("UsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).UsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).LocalUsedCapacityInByte = (long?) content.GetValueForProperty("LocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).LocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileShareProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ShareStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).ShareStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) content.GetValueForProperty("ShareStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).ShareStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus.CreateFrom); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("AdminUser")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).AdminUser = (string) content.GetValueForProperty("AdminUser",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).AdminUser, global::System.Convert.ToString); + } + if (content.Contains("ProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).ProvisionedCapacityInByte = (long) content.GetValueForProperty("ProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).ProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).UsedCapacityInByte = (long?) content.GetValueForProperty("UsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).UsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).LocalUsedCapacityInByte = (long?) content.GetValueForProperty("LocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).LocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The File Share. + [System.ComponentModel.TypeConverter(typeof(FileSharePropertiesTypeConverter))] + public partial interface IFileShareProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareProperties.TypeConverter.cs new file mode 100644 index 000000000000..e5e115b35e3c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileSharePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileShareProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileShareProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileShareProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareProperties.cs new file mode 100644 index 000000000000..4de0d19737cc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareProperties.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The File Share. + public partial class FileShareProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal + { + + /// Backing field for property. + private string _adminUser; + + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string AdminUser { get => this._adminUser; set => this._adminUser = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy _dataPolicy; + + /// The data policy + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get => this._dataPolicy; set => this._dataPolicy = value; } + + /// Backing field for property. + private string _description; + + /// Description for file share + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private long? _localUsedCapacityInByte; + + /// The local used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? LocalUsedCapacityInByte { get => this._localUsedCapacityInByte; } + + /// Internal Acessors for LocalUsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal.LocalUsedCapacityInByte { get => this._localUsedCapacityInByte; set { {_localUsedCapacityInByte = value;} } } + + /// Internal Acessors for UsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileSharePropertiesInternal.UsedCapacityInByte { get => this._usedCapacityInByte; set { {_usedCapacityInByte = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus _monitoringStatus; + + /// The monitoring status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get => this._monitoringStatus; set => this._monitoringStatus = value; } + + /// Backing field for property. + private long _provisionedCapacityInByte; + + /// The total provisioned capacity in Bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long ProvisionedCapacityInByte { get => this._provisionedCapacityInByte; set => this._provisionedCapacityInByte = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus _shareStatus; + + /// The Share Status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus ShareStatus { get => this._shareStatus; set => this._shareStatus = value; } + + /// Backing field for property. + private long? _usedCapacityInByte; + + /// The used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? UsedCapacityInByte { get => this._usedCapacityInByte; } + + /// Creates an new instance. + public FileShareProperties() + { + + } + } + /// The File Share. + public partial interface IFileShareProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\xyz.", + SerializedName = @"adminUser", + PossibleTypes = new [] { typeof(string) })] + string AdminUser { get; set; } + /// The data policy + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The data policy", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get; set; } + /// Description for file share + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description for file share", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The local used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The local used capacity in Bytes.", + SerializedName = @"localUsedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? LocalUsedCapacityInByte { get; } + /// The monitoring status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The monitoring status", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get; set; } + /// The total provisioned capacity in Bytes + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The total provisioned capacity in Bytes", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long ProvisionedCapacityInByte { get; set; } + /// The Share Status + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Share Status", + SerializedName = @"shareStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus ShareStatus { get; set; } + /// The used capacity in Bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The used capacity in Bytes.", + SerializedName = @"usedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? UsedCapacityInByte { get; } + + } + /// The File Share. + internal partial interface IFileSharePropertiesInternal + + { + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + string AdminUser { get; set; } + /// The data policy + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get; set; } + /// Description for file share + string Description { get; set; } + /// The local used capacity in Bytes. + long? LocalUsedCapacityInByte { get; set; } + /// The monitoring status + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get; set; } + /// The total provisioned capacity in Bytes + long ProvisionedCapacityInByte { get; set; } + /// The Share Status + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus ShareStatus { get; set; } + /// The used capacity in Bytes. + long? UsedCapacityInByte { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareProperties.json.cs new file mode 100644 index 000000000000..c9fcae2e28ae --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/FileShareProperties.json.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The File Share. + public partial class FileShareProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal FileShareProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_shareStatus = If( json?.PropertyT("shareStatus"), out var __jsonShareStatus) ? (string)__jsonShareStatus : (string)ShareStatus;} + {_dataPolicy = If( json?.PropertyT("dataPolicy"), out var __jsonDataPolicy) ? (string)__jsonDataPolicy : (string)DataPolicy;} + {_adminUser = If( json?.PropertyT("adminUser"), out var __jsonAdminUser) ? (string)__jsonAdminUser : (string)AdminUser;} + {_provisionedCapacityInByte = If( json?.PropertyT("provisionedCapacityInBytes"), out var __jsonProvisionedCapacityInBytes) ? (long)__jsonProvisionedCapacityInBytes : ProvisionedCapacityInByte;} + {_usedCapacityInByte = If( json?.PropertyT("usedCapacityInBytes"), out var __jsonUsedCapacityInBytes) ? (long?)__jsonUsedCapacityInBytes : UsedCapacityInByte;} + {_localUsedCapacityInByte = If( json?.PropertyT("localUsedCapacityInBytes"), out var __jsonLocalUsedCapacityInBytes) ? (long?)__jsonLocalUsedCapacityInBytes : LocalUsedCapacityInByte;} + {_monitoringStatus = If( json?.PropertyT("monitoringStatus"), out var __jsonMonitoringStatus) ? (string)__jsonMonitoringStatus : (string)MonitoringStatus;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new FileShareProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._shareStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._shareStatus.ToString()) : null, "shareStatus" ,container.Add ); + AddIf( null != (((object)this._dataPolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._dataPolicy.ToString()) : null, "dataPolicy" ,container.Add ); + AddIf( null != (((object)this._adminUser)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._adminUser.ToString()) : null, "adminUser" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber(this._provisionedCapacityInByte), "provisionedCapacityInBytes" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usedCapacityInByte ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._usedCapacityInByte) : null, "usedCapacityInBytes" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._localUsedCapacityInByte ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._localUsedCapacityInByte) : null, "localUsedCapacityInBytes" ,container.Add ); + } + AddIf( null != (((object)this._monitoringStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._monitoringStatus.ToString()) : null, "monitoringStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IPConfig.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IPConfig.PowerShell.cs new file mode 100644 index 000000000000..cab6ccfdf6eb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IPConfig.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Details related to the IP address configuration + [System.ComponentModel.TypeConverter(typeof(IPConfigTypeConverter))] + public partial class IPConfig + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IPConfig(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IPConfig(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IPConfig(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)this).IPAddress = (string) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)this).IPAddress, global::System.Convert.ToString); + } + if (content.Contains("PrefixLength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)this).PrefixLength = (int?) content.GetValueForProperty("PrefixLength",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)this).PrefixLength, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Gateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)this).Gateway = (string) content.GetValueForProperty("Gateway",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)this).Gateway, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IPConfig(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)this).IPAddress = (string) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)this).IPAddress, global::System.Convert.ToString); + } + if (content.Contains("PrefixLength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)this).PrefixLength = (int?) content.GetValueForProperty("PrefixLength",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)this).PrefixLength, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Gateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)this).Gateway = (string) content.GetValueForProperty("Gateway",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)this).Gateway, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Details related to the IP address configuration + [System.ComponentModel.TypeConverter(typeof(IPConfigTypeConverter))] + public partial interface IIPConfig + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IPConfig.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IPConfig.TypeConverter.cs new file mode 100644 index 000000000000..b9d6e7b57edc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IPConfig.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IPConfigTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IPConfig.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IPConfig.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IPConfig.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IPConfig.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IPConfig.cs new file mode 100644 index 000000000000..6888555ddd3f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IPConfig.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Details related to the IP address configuration + public partial class IPConfig : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal + { + + /// Backing field for property. + private string _gateway; + + /// The gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Gateway { get => this._gateway; set => this._gateway = value; } + + /// Backing field for property. + private string _iPAddress; + + /// The IP address of the network adapter, either ipv4 or ipv6. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string IPAddress { get => this._iPAddress; set => this._iPAddress = value; } + + /// Backing field for property. + private int? _prefixLength; + + /// The prefix length of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? PrefixLength { get => this._prefixLength; set => this._prefixLength = value; } + + /// Creates an new instance. + public IPConfig() + { + + } + } + /// Details related to the IP address configuration + public partial interface IIPConfig : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The gateway of the network adapter.", + SerializedName = @"gateway", + PossibleTypes = new [] { typeof(string) })] + string Gateway { get; set; } + /// The IP address of the network adapter, either ipv4 or ipv6. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The IP address of the network adapter, either ipv4 or ipv6.", + SerializedName = @"ipAddress", + PossibleTypes = new [] { typeof(string) })] + string IPAddress { get; set; } + /// The prefix length of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The prefix length of the network adapter.", + SerializedName = @"prefixLength", + PossibleTypes = new [] { typeof(int) })] + int? PrefixLength { get; set; } + + } + /// Details related to the IP address configuration + internal partial interface IIPConfigInternal + + { + /// The gateway of the network adapter. + string Gateway { get; set; } + /// The IP address of the network adapter, either ipv4 or ipv6. + string IPAddress { get; set; } + /// The prefix length of the network adapter. + int? PrefixLength { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IPConfig.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IPConfig.json.cs new file mode 100644 index 000000000000..602e6dffcd0e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IPConfig.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Details related to the IP address configuration + public partial class IPConfig + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new IPConfig(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal IPConfig(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_iPAddress = If( json?.PropertyT("ipAddress"), out var __jsonIPAddress) ? (string)__jsonIPAddress : (string)IPAddress;} + {_prefixLength = If( json?.PropertyT("prefixLength"), out var __jsonPrefixLength) ? (int?)__jsonPrefixLength : PrefixLength;} + {_gateway = If( json?.PropertyT("gateway"), out var __jsonGateway) ? (string)__jsonGateway : (string)Gateway;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._iPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._iPAddress.ToString()) : null, "ipAddress" ,container.Add ); + AddIf( null != this._prefixLength ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._prefixLength) : null, "prefixLength" ,container.Add ); + AddIf( null != (((object)this._gateway)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._gateway.ToString()) : null, "gateway" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDisk.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDisk.PowerShell.cs new file mode 100644 index 000000000000..309aae3d3b40 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDisk.PowerShell.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The iSCSI disk. + [System.ComponentModel.TypeConverter(typeof(IscsiDiskTypeConverter))] + public partial class IscsiDisk + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IscsiDisk(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IscsiDisk(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiDisk(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DiskStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).DiskStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) content.GetValueForProperty("DiskStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).DiskStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus.CreateFrom); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("AccessControlRecord")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).AccessControlRecord = (string[]) content.GetValueForProperty("AccessControlRecord",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).AccessControlRecord, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).ProvisionedCapacityInByte = (long) content.GetValueForProperty("ProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).ProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).UsedCapacityInByte = (long?) content.GetValueForProperty("UsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).UsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).LocalUsedCapacityInByte = (long?) content.GetValueForProperty("LocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).LocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiDisk(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DiskStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).DiskStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) content.GetValueForProperty("DiskStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).DiskStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus.CreateFrom); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("AccessControlRecord")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).AccessControlRecord = (string[]) content.GetValueForProperty("AccessControlRecord",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).AccessControlRecord, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).ProvisionedCapacityInByte = (long) content.GetValueForProperty("ProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).ProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).UsedCapacityInByte = (long?) content.GetValueForProperty("UsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).UsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).LocalUsedCapacityInByte = (long?) content.GetValueForProperty("LocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal)this).LocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The iSCSI disk. + [System.ComponentModel.TypeConverter(typeof(IscsiDiskTypeConverter))] + public partial interface IIscsiDisk + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDisk.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDisk.TypeConverter.cs new file mode 100644 index 000000000000..ef6b21228ad2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDisk.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IscsiDiskTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IscsiDisk.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IscsiDisk.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IscsiDisk.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDisk.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDisk.cs new file mode 100644 index 000000000000..a12fc6ec72e1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDisk.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The iSCSI disk. + public partial class IscsiDisk : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The access control records. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string[] AccessControlRecord { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).AccessControlRecord; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).AccessControlRecord = value ; } + + /// The data policy. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).DataPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).DataPolicy = value ; } + + /// The description. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).Description = value ?? null; } + + /// The disk status. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus DiskStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).DiskStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).DiskStatus = value ; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// The local used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? LocalUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).LocalUsedCapacityInByte; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for LocalUsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal.LocalUsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).LocalUsedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).LocalUsedCapacityInByte = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskProperties()); set { {_property = value;} } } + + /// Internal Acessors for UsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskInternal.UsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).UsedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).UsedCapacityInByte = value; } + + /// The monitoring. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).MonitoringStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).MonitoringStatus = value ; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties _property; + + /// The properties. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskProperties()); set => this._property = value; } + + /// The provisioned capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long ProvisionedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).ProvisionedCapacityInByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).ProvisionedCapacityInByte = value ; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// The used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long? UsedCapacityInByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)Property).UsedCapacityInByte; } + + /// Creates an new instance. + public IscsiDisk() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The iSCSI disk. + public partial interface IIscsiDisk : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// The access control records. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The access control records.", + SerializedName = @"accessControlRecords", + PossibleTypes = new [] { typeof(string) })] + string[] AccessControlRecord { get; set; } + /// The data policy. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The data policy.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get; set; } + /// The description. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The disk status. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The disk status.", + SerializedName = @"diskStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus DiskStatus { get; set; } + /// The local used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The local used capacity in bytes.", + SerializedName = @"localUsedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? LocalUsedCapacityInByte { get; } + /// The monitoring. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The monitoring.", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get; set; } + /// The provisioned capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The provisioned capacity in bytes.", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long ProvisionedCapacityInByte { get; set; } + /// The used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The used capacity in bytes.", + SerializedName = @"usedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? UsedCapacityInByte { get; } + + } + /// The iSCSI disk. + internal partial interface IIscsiDiskInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The access control records. + string[] AccessControlRecord { get; set; } + /// The data policy. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get; set; } + /// The description. + string Description { get; set; } + /// The disk status. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus DiskStatus { get; set; } + /// The local used capacity in bytes. + long? LocalUsedCapacityInByte { get; set; } + /// The monitoring. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get; set; } + /// The properties. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties Property { get; set; } + /// The provisioned capacity in bytes. + long ProvisionedCapacityInByte { get; set; } + /// The used capacity in bytes. + long? UsedCapacityInByte { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDisk.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDisk.json.cs new file mode 100644 index 000000000000..fabac4efb545 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDisk.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The iSCSI disk. + public partial class IscsiDisk + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new IscsiDisk(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal IscsiDisk(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskList.PowerShell.cs new file mode 100644 index 000000000000..7f4d1fcab5df --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskList.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Collection of Iscsi disk + [System.ComponentModel.TypeConverter(typeof(IscsiDiskListTypeConverter))] + public partial class IscsiDiskList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IscsiDiskList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IscsiDiskList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiDiskList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiDiskList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of Iscsi disk + [System.ComponentModel.TypeConverter(typeof(IscsiDiskListTypeConverter))] + public partial interface IIscsiDiskList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskList.TypeConverter.cs new file mode 100644 index 000000000000..5d67aed41f0f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IscsiDiskListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IscsiDiskList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IscsiDiskList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IscsiDiskList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskList.cs new file mode 100644 index 000000000000..657dd316052e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of Iscsi disk + public partial class IscsiDiskList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public IscsiDiskList() + { + + } + } + /// Collection of Iscsi disk + public partial interface IIscsiDiskList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk[] Value { get; set; } + + } + /// Collection of Iscsi disk + internal partial interface IIscsiDiskListInternal + + { + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskList.json.cs new file mode 100644 index 000000000000..f5e5a30d3450 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of Iscsi disk + public partial class IscsiDiskList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new IscsiDiskList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal IscsiDiskList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDisk.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskProperties.PowerShell.cs new file mode 100644 index 000000000000..88242a26c2c7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskProperties.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The iSCSI disk properties. + [System.ComponentModel.TypeConverter(typeof(IscsiDiskPropertiesTypeConverter))] + public partial class IscsiDiskProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IscsiDiskProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IscsiDiskProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiDiskProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("DiskStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).DiskStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) content.GetValueForProperty("DiskStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).DiskStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus.CreateFrom); + } + if (content.Contains("AccessControlRecord")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).AccessControlRecord = (string[]) content.GetValueForProperty("AccessControlRecord",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).AccessControlRecord, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("ProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).ProvisionedCapacityInByte = (long) content.GetValueForProperty("ProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).ProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).UsedCapacityInByte = (long?) content.GetValueForProperty("UsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).UsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).LocalUsedCapacityInByte = (long?) content.GetValueForProperty("LocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).LocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiDiskProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("DiskStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).DiskStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) content.GetValueForProperty("DiskStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).DiskStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus.CreateFrom); + } + if (content.Contains("AccessControlRecord")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).AccessControlRecord = (string[]) content.GetValueForProperty("AccessControlRecord",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).AccessControlRecord, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DataPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).DataPolicy = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) content.GetValueForProperty("DataPolicy",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).DataPolicy, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy.CreateFrom); + } + if (content.Contains("ProvisionedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).ProvisionedCapacityInByte = (long) content.GetValueForProperty("ProvisionedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).ProvisionedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).UsedCapacityInByte = (long?) content.GetValueForProperty("UsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).UsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LocalUsedCapacityInByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).LocalUsedCapacityInByte = (long?) content.GetValueForProperty("LocalUsedCapacityInByte",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).LocalUsedCapacityInByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("MonitoringStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).MonitoringStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) content.GetValueForProperty("MonitoringStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal)this).MonitoringStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The iSCSI disk properties. + [System.ComponentModel.TypeConverter(typeof(IscsiDiskPropertiesTypeConverter))] + public partial interface IIscsiDiskProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskProperties.TypeConverter.cs new file mode 100644 index 000000000000..1351db7457d7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IscsiDiskPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IscsiDiskProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IscsiDiskProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IscsiDiskProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskProperties.cs new file mode 100644 index 000000000000..29d1296c988f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskProperties.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The iSCSI disk properties. + public partial class IscsiDiskProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal + { + + /// Backing field for property. + private string[] _accessControlRecord; + + /// The access control records. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string[] AccessControlRecord { get => this._accessControlRecord; set => this._accessControlRecord = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy _dataPolicy; + + /// The data policy. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get => this._dataPolicy; set => this._dataPolicy = value; } + + /// Backing field for property. + private string _description; + + /// The description. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus _diskStatus; + + /// The disk status. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus DiskStatus { get => this._diskStatus; set => this._diskStatus = value; } + + /// Backing field for property. + private long? _localUsedCapacityInByte; + + /// The local used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? LocalUsedCapacityInByte { get => this._localUsedCapacityInByte; } + + /// Internal Acessors for LocalUsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal.LocalUsedCapacityInByte { get => this._localUsedCapacityInByte; set { {_localUsedCapacityInByte = value;} } } + + /// Internal Acessors for UsedCapacityInByte + long? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskPropertiesInternal.UsedCapacityInByte { get => this._usedCapacityInByte; set { {_usedCapacityInByte = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus _monitoringStatus; + + /// The monitoring. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get => this._monitoringStatus; set => this._monitoringStatus = value; } + + /// Backing field for property. + private long _provisionedCapacityInByte; + + /// The provisioned capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long ProvisionedCapacityInByte { get => this._provisionedCapacityInByte; set => this._provisionedCapacityInByte = value; } + + /// Backing field for property. + private long? _usedCapacityInByte; + + /// The used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? UsedCapacityInByte { get => this._usedCapacityInByte; } + + /// Creates an new instance. + public IscsiDiskProperties() + { + + } + } + /// The iSCSI disk properties. + public partial interface IIscsiDiskProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The access control records. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The access control records.", + SerializedName = @"accessControlRecords", + PossibleTypes = new [] { typeof(string) })] + string[] AccessControlRecord { get; set; } + /// The data policy. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The data policy.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get; set; } + /// The description. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The disk status. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The disk status.", + SerializedName = @"diskStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus DiskStatus { get; set; } + /// The local used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The local used capacity in bytes.", + SerializedName = @"localUsedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? LocalUsedCapacityInByte { get; } + /// The monitoring. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The monitoring.", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get; set; } + /// The provisioned capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The provisioned capacity in bytes.", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long ProvisionedCapacityInByte { get; set; } + /// The used capacity in bytes. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The used capacity in bytes.", + SerializedName = @"usedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + long? UsedCapacityInByte { get; } + + } + /// The iSCSI disk properties. + internal partial interface IIscsiDiskPropertiesInternal + + { + /// The access control records. + string[] AccessControlRecord { get; set; } + /// The data policy. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get; set; } + /// The description. + string Description { get; set; } + /// The disk status. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus DiskStatus { get; set; } + /// The local used capacity in bytes. + long? LocalUsedCapacityInByte { get; set; } + /// The monitoring. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get; set; } + /// The provisioned capacity in bytes. + long ProvisionedCapacityInByte { get; set; } + /// The used capacity in bytes. + long? UsedCapacityInByte { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskProperties.json.cs new file mode 100644 index 000000000000..6fefd2989040 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiDiskProperties.json.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The iSCSI disk properties. + public partial class IscsiDiskProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new IscsiDiskProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal IscsiDiskProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_diskStatus = If( json?.PropertyT("diskStatus"), out var __jsonDiskStatus) ? (string)__jsonDiskStatus : (string)DiskStatus;} + {_accessControlRecord = If( json?.PropertyT("accessControlRecords"), out var __jsonAccessControlRecords) ? If( __jsonAccessControlRecords as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AccessControlRecord;} + {_dataPolicy = If( json?.PropertyT("dataPolicy"), out var __jsonDataPolicy) ? (string)__jsonDataPolicy : (string)DataPolicy;} + {_provisionedCapacityInByte = If( json?.PropertyT("provisionedCapacityInBytes"), out var __jsonProvisionedCapacityInBytes) ? (long)__jsonProvisionedCapacityInBytes : ProvisionedCapacityInByte;} + {_usedCapacityInByte = If( json?.PropertyT("usedCapacityInBytes"), out var __jsonUsedCapacityInBytes) ? (long?)__jsonUsedCapacityInBytes : UsedCapacityInByte;} + {_localUsedCapacityInByte = If( json?.PropertyT("localUsedCapacityInBytes"), out var __jsonLocalUsedCapacityInBytes) ? (long?)__jsonLocalUsedCapacityInBytes : LocalUsedCapacityInByte;} + {_monitoringStatus = If( json?.PropertyT("monitoringStatus"), out var __jsonMonitoringStatus) ? (string)__jsonMonitoringStatus : (string)MonitoringStatus;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._diskStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._diskStatus.ToString()) : null, "diskStatus" ,container.Add ); + if (null != this._accessControlRecord) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._accessControlRecord ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("accessControlRecords",__w); + } + AddIf( null != (((object)this._dataPolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._dataPolicy.ToString()) : null, "dataPolicy" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber(this._provisionedCapacityInByte), "provisionedCapacityInBytes" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usedCapacityInByte ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._usedCapacityInByte) : null, "usedCapacityInBytes" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._localUsedCapacityInByte ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._localUsedCapacityInByte) : null, "localUsedCapacityInBytes" ,container.Add ); + } + AddIf( null != (((object)this._monitoringStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._monitoringStatus.ToString()) : null, "monitoringStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServer.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServer.PowerShell.cs new file mode 100644 index 000000000000..53917d1f5f4d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServer.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The iSCSI server. + [System.ComponentModel.TypeConverter(typeof(IscsiServerTypeConverter))] + public partial class IscsiServer + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IscsiServer(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IscsiServer(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiServer(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("StorageDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).StorageDomainId = (string) content.GetValueForProperty("StorageDomainId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).StorageDomainId, global::System.Convert.ToString); + } + if (content.Contains("BackupScheduleGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).BackupScheduleGroupId = (string) content.GetValueForProperty("BackupScheduleGroupId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).BackupScheduleGroupId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ChapId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).ChapId = (string) content.GetValueForProperty("ChapId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).ChapId, global::System.Convert.ToString); + } + if (content.Contains("ReverseChapId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).ReverseChapId = (string) content.GetValueForProperty("ReverseChapId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).ReverseChapId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiServer(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("StorageDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).StorageDomainId = (string) content.GetValueForProperty("StorageDomainId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).StorageDomainId, global::System.Convert.ToString); + } + if (content.Contains("BackupScheduleGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).BackupScheduleGroupId = (string) content.GetValueForProperty("BackupScheduleGroupId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).BackupScheduleGroupId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ChapId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).ChapId = (string) content.GetValueForProperty("ChapId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).ChapId, global::System.Convert.ToString); + } + if (content.Contains("ReverseChapId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).ReverseChapId = (string) content.GetValueForProperty("ReverseChapId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal)this).ReverseChapId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The iSCSI server. + [System.ComponentModel.TypeConverter(typeof(IscsiServerTypeConverter))] + public partial interface IIscsiServer + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServer.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServer.TypeConverter.cs new file mode 100644 index 000000000000..ab3da4733edb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServer.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IscsiServerTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IscsiServer.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IscsiServer.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IscsiServer.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServer.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServer.cs new file mode 100644 index 000000000000..fc8c750fc61a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServer.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The iSCSI server. + public partial class IscsiServer : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The backup policy id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string BackupScheduleGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)Property).BackupScheduleGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)Property).BackupScheduleGroupId = value ; } + + /// The chap id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ChapId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)Property).ChapId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)Property).ChapId = value ?? null; } + + /// The description. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)Property).Description = value ?? null; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServerProperties()); set { {_property = value;} } } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties _property; + + /// The properties. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServerProperties()); set => this._property = value; } + + /// The reverse chap id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ReverseChapId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)Property).ReverseChapId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)Property).ReverseChapId = value ?? null; } + + /// The storage domain id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string StorageDomainId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)Property).StorageDomainId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)Property).StorageDomainId = value ; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public IscsiServer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The iSCSI server. + public partial interface IIscsiServer : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// The backup policy id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup policy id.", + SerializedName = @"backupScheduleGroupId", + PossibleTypes = new [] { typeof(string) })] + string BackupScheduleGroupId { get; set; } + /// The chap id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The chap id.", + SerializedName = @"chapId", + PossibleTypes = new [] { typeof(string) })] + string ChapId { get; set; } + /// The description. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The reverse chap id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reverse chap id.", + SerializedName = @"reverseChapId", + PossibleTypes = new [] { typeof(string) })] + string ReverseChapId { get; set; } + /// The storage domain id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage domain id.", + SerializedName = @"storageDomainId", + PossibleTypes = new [] { typeof(string) })] + string StorageDomainId { get; set; } + + } + /// The iSCSI server. + internal partial interface IIscsiServerInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The backup policy id. + string BackupScheduleGroupId { get; set; } + /// The chap id. + string ChapId { get; set; } + /// The description. + string Description { get; set; } + /// The properties. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties Property { get; set; } + /// The reverse chap id. + string ReverseChapId { get; set; } + /// The storage domain id. + string StorageDomainId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServer.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServer.json.cs new file mode 100644 index 000000000000..0c7649b9e5cc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServer.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The iSCSI server. + public partial class IscsiServer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new IscsiServer(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal IscsiServer(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServerProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerList.PowerShell.cs new file mode 100644 index 000000000000..88f6874f88aa --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerList.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Collection of Iscsi servers + [System.ComponentModel.TypeConverter(typeof(IscsiServerListTypeConverter))] + public partial class IscsiServerList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IscsiServerList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IscsiServerList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiServerList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServerTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiServerList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServerTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of Iscsi servers + [System.ComponentModel.TypeConverter(typeof(IscsiServerListTypeConverter))] + public partial interface IIscsiServerList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerList.TypeConverter.cs new file mode 100644 index 000000000000..3f8d56004903 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IscsiServerListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IscsiServerList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IscsiServerList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IscsiServerList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerList.cs new file mode 100644 index 000000000000..0fe9c101441e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of Iscsi servers + public partial class IscsiServerList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public IscsiServerList() + { + + } + } + /// Collection of Iscsi servers + public partial interface IIscsiServerList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer[] Value { get; set; } + + } + /// Collection of Iscsi servers + internal partial interface IIscsiServerListInternal + + { + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerList.json.cs new file mode 100644 index 000000000000..441c3609219d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of Iscsi servers + public partial class IscsiServerList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new IscsiServerList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal IscsiServerList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServer.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerProperties.PowerShell.cs new file mode 100644 index 000000000000..4e766c5ac45f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerProperties.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The iSCSI server properties. + [System.ComponentModel.TypeConverter(typeof(IscsiServerPropertiesTypeConverter))] + public partial class IscsiServerProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IscsiServerProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IscsiServerProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IscsiServerProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).StorageDomainId = (string) content.GetValueForProperty("StorageDomainId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).StorageDomainId, global::System.Convert.ToString); + } + if (content.Contains("BackupScheduleGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).BackupScheduleGroupId = (string) content.GetValueForProperty("BackupScheduleGroupId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).BackupScheduleGroupId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ChapId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).ChapId = (string) content.GetValueForProperty("ChapId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).ChapId, global::System.Convert.ToString); + } + if (content.Contains("ReverseChapId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).ReverseChapId = (string) content.GetValueForProperty("ReverseChapId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).ReverseChapId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IscsiServerProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).StorageDomainId = (string) content.GetValueForProperty("StorageDomainId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).StorageDomainId, global::System.Convert.ToString); + } + if (content.Contains("BackupScheduleGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).BackupScheduleGroupId = (string) content.GetValueForProperty("BackupScheduleGroupId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).BackupScheduleGroupId, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ChapId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).ChapId = (string) content.GetValueForProperty("ChapId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).ChapId, global::System.Convert.ToString); + } + if (content.Contains("ReverseChapId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).ReverseChapId = (string) content.GetValueForProperty("ReverseChapId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal)this).ReverseChapId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The iSCSI server properties. + [System.ComponentModel.TypeConverter(typeof(IscsiServerPropertiesTypeConverter))] + public partial interface IIscsiServerProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerProperties.TypeConverter.cs new file mode 100644 index 000000000000..3aea8133c745 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IscsiServerPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IscsiServerProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IscsiServerProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IscsiServerProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerProperties.cs new file mode 100644 index 000000000000..f9d605440367 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerProperties.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The iSCSI server properties. + public partial class IscsiServerProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerPropertiesInternal + { + + /// Backing field for property. + private string _backupScheduleGroupId; + + /// The backup policy id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string BackupScheduleGroupId { get => this._backupScheduleGroupId; set => this._backupScheduleGroupId = value; } + + /// Backing field for property. + private string _chapId; + + /// The chap id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ChapId { get => this._chapId; set => this._chapId = value; } + + /// Backing field for property. + private string _description; + + /// The description. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _reverseChapId; + + /// The reverse chap id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ReverseChapId { get => this._reverseChapId; set => this._reverseChapId = value; } + + /// Backing field for property. + private string _storageDomainId; + + /// The storage domain id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string StorageDomainId { get => this._storageDomainId; set => this._storageDomainId = value; } + + /// Creates an new instance. + public IscsiServerProperties() + { + + } + } + /// The iSCSI server properties. + public partial interface IIscsiServerProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The backup policy id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup policy id.", + SerializedName = @"backupScheduleGroupId", + PossibleTypes = new [] { typeof(string) })] + string BackupScheduleGroupId { get; set; } + /// The chap id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The chap id.", + SerializedName = @"chapId", + PossibleTypes = new [] { typeof(string) })] + string ChapId { get; set; } + /// The description. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The reverse chap id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reverse chap id.", + SerializedName = @"reverseChapId", + PossibleTypes = new [] { typeof(string) })] + string ReverseChapId { get; set; } + /// The storage domain id. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage domain id.", + SerializedName = @"storageDomainId", + PossibleTypes = new [] { typeof(string) })] + string StorageDomainId { get; set; } + + } + /// The iSCSI server properties. + internal partial interface IIscsiServerPropertiesInternal + + { + /// The backup policy id. + string BackupScheduleGroupId { get; set; } + /// The chap id. + string ChapId { get; set; } + /// The description. + string Description { get; set; } + /// The reverse chap id. + string ReverseChapId { get; set; } + /// The storage domain id. + string StorageDomainId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerProperties.json.cs new file mode 100644 index 000000000000..343c796547b4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/IscsiServerProperties.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The iSCSI server properties. + public partial class IscsiServerProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new IscsiServerProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal IscsiServerProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_storageDomainId = If( json?.PropertyT("storageDomainId"), out var __jsonStorageDomainId) ? (string)__jsonStorageDomainId : (string)StorageDomainId;} + {_backupScheduleGroupId = If( json?.PropertyT("backupScheduleGroupId"), out var __jsonBackupScheduleGroupId) ? (string)__jsonBackupScheduleGroupId : (string)BackupScheduleGroupId;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_chapId = If( json?.PropertyT("chapId"), out var __jsonChapId) ? (string)__jsonChapId : (string)ChapId;} + {_reverseChapId = If( json?.PropertyT("reverseChapId"), out var __jsonReverseChapId) ? (string)__jsonReverseChapId : (string)ReverseChapId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._storageDomainId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._storageDomainId.ToString()) : null, "storageDomainId" ,container.Add ); + AddIf( null != (((object)this._backupScheduleGroupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._backupScheduleGroupId.ToString()) : null, "backupScheduleGroupId" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._chapId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._chapId.ToString()) : null, "chapId" ,container.Add ); + AddIf( null != (((object)this._reverseChapId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._reverseChapId.ToString()) : null, "reverseChapId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Item.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Item.PowerShell.cs new file mode 100644 index 000000000000..5e07c3917755 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Item.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ItemTypeConverter))] + public partial class Item + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Item(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Item(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Item(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItemInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItemInternal)this).Key, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItemInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItemInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Item(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItemInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItemInternal)this).Key, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItemInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItemInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ItemTypeConverter))] + public partial interface IItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Item.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Item.TypeConverter.cs new file mode 100644 index 000000000000..438d93bc9a97 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Item.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Item.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Item.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Item.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Item.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Item.cs new file mode 100644 index 000000000000..535518f62be3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Item.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + public partial class Item : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItemInternal + { + + /// Backing field for property. + private string _key; + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Key { get => this._key; set => this._key = value; } + + /// Backing field for property. + private string _value; + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public Item() + { + + } + } + public partial interface IItem : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"key", + PossibleTypes = new [] { typeof(string) })] + string Key { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + internal partial interface IItemInternal + + { + string Key { get; set; } + + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Item.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Item.json.cs new file mode 100644 index 000000000000..9e7f9854c8be --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Item.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + public partial class Item + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new Item(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal Item(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Key;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._key)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._key.ToString()) : null, "key" ,container.Add ); + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Job.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Job.PowerShell.cs new file mode 100644 index 000000000000..c1ee7c64d75f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Job.PowerShell.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The Job. + [System.ComponentModel.TypeConverter(typeof(JobTypeConverter))] + public partial class Job + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Job(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Job(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Job(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus.CreateFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).PercentComplete = (int) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).PercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).JobType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).JobType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType.CreateFrom); + } + if (content.Contains("TargetType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).TargetType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType?) content.GetValueForProperty("TargetType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).TargetType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType.CreateFrom); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorItemTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Stat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Stat = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats) content.GetValueForProperty("Stat",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Stat, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStatsTypeConverter.ConvertFrom); + } + if (content.Contains("DownloadProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgress = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress) content.GetValueForProperty("DownloadProgress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgress, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateDownloadProgressTypeConverter.ConvertFrom); + } + if (content.Contains("InstallProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgress = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress) content.GetValueForProperty("InstallProgress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgress, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateInstallProgressTypeConverter.ConvertFrom); + } + if (content.Contains("TargetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).TargetId, global::System.Convert.ToString); + } + if (content.Contains("EntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).EntityId = (string) content.GetValueForProperty("EntityId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).EntityId, global::System.Convert.ToString); + } + if (content.Contains("EntityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).EntityType = (string) content.GetValueForProperty("EntityType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).EntityType, global::System.Convert.ToString); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage[]) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Stage, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStageTypeConverter.ConvertFrom)); + } + if (content.Contains("DeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DeviceId = (string) content.GetValueForProperty("DeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DeviceId, global::System.Convert.ToString); + } + if (content.Contains("IsCancellable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).IsCancellable = (bool?) content.GetValueForProperty("IsCancellable",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).IsCancellable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).SourceDeviceId = (string) content.GetValueForProperty("SourceDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).SourceDeviceId, global::System.Convert.ToString); + } + if (content.Contains("BackupPointInTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).BackupPointInTime = (global::System.DateTime?) content.GetValueForProperty("BackupPointInTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).BackupPointInTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DownloadProgressDownloadPhase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressDownloadPhase = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase?) content.GetValueForProperty("DownloadProgressDownloadPhase",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressDownloadPhase, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase.CreateFrom); + } + if (content.Contains("StatCompletedWorkItemCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StatCompletedWorkItemCount = (int?) content.GetValueForProperty("StatCompletedWorkItemCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StatCompletedWorkItemCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StatTotalWorkItemCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StatTotalWorkItemCount = (int?) content.GetValueForProperty("StatTotalWorkItemCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StatTotalWorkItemCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StatEstimatedTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StatEstimatedTimeRemaining = (int?) content.GetValueForProperty("StatEstimatedTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StatEstimatedTimeRemaining, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressPercentComplete = (int?) content.GetValueForProperty("DownloadProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressTotalBytesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressTotalBytesToDownload = (double?) content.GetValueForProperty("DownloadProgressTotalBytesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressTotalBytesToDownload, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressTotalBytesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressTotalBytesDownloaded = (double?) content.GetValueForProperty("DownloadProgressTotalBytesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressTotalBytesDownloaded, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressNumberOfUpdatesToDownload = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressNumberOfUpdatesToDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressNumberOfUpdatesDownloaded = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressNumberOfUpdatesDownloaded, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgressPercentComplete = (int?) content.GetValueForProperty("InstallProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesToInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgressNumberOfUpdatesToInstall = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesToInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgressNumberOfUpdatesToInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesInstalled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgressNumberOfUpdatesInstalled = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesInstalled",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgressNumberOfUpdatesInstalled, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Job(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus.CreateFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).PercentComplete = (int) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).PercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).JobType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).JobType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType.CreateFrom); + } + if (content.Contains("TargetType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).TargetType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType?) content.GetValueForProperty("TargetType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).TargetType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType.CreateFrom); + } + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorItemTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Stat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Stat = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats) content.GetValueForProperty("Stat",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Stat, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStatsTypeConverter.ConvertFrom); + } + if (content.Contains("DownloadProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgress = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress) content.GetValueForProperty("DownloadProgress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgress, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateDownloadProgressTypeConverter.ConvertFrom); + } + if (content.Contains("InstallProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgress = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress) content.GetValueForProperty("InstallProgress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgress, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateInstallProgressTypeConverter.ConvertFrom); + } + if (content.Contains("TargetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).TargetId, global::System.Convert.ToString); + } + if (content.Contains("EntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).EntityId = (string) content.GetValueForProperty("EntityId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).EntityId, global::System.Convert.ToString); + } + if (content.Contains("EntityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).EntityType = (string) content.GetValueForProperty("EntityType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).EntityType, global::System.Convert.ToString); + } + if (content.Contains("Stage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Stage = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage[]) content.GetValueForProperty("Stage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).Stage, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStageTypeConverter.ConvertFrom)); + } + if (content.Contains("DeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DeviceId = (string) content.GetValueForProperty("DeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DeviceId, global::System.Convert.ToString); + } + if (content.Contains("IsCancellable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).IsCancellable = (bool?) content.GetValueForProperty("IsCancellable",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).IsCancellable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SourceDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).SourceDeviceId = (string) content.GetValueForProperty("SourceDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).SourceDeviceId, global::System.Convert.ToString); + } + if (content.Contains("BackupPointInTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).BackupPointInTime = (global::System.DateTime?) content.GetValueForProperty("BackupPointInTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).BackupPointInTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DownloadProgressDownloadPhase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressDownloadPhase = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase?) content.GetValueForProperty("DownloadProgressDownloadPhase",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressDownloadPhase, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase.CreateFrom); + } + if (content.Contains("StatCompletedWorkItemCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StatCompletedWorkItemCount = (int?) content.GetValueForProperty("StatCompletedWorkItemCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StatCompletedWorkItemCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StatTotalWorkItemCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StatTotalWorkItemCount = (int?) content.GetValueForProperty("StatTotalWorkItemCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StatTotalWorkItemCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StatEstimatedTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StatEstimatedTimeRemaining = (int?) content.GetValueForProperty("StatEstimatedTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).StatEstimatedTimeRemaining, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressPercentComplete = (int?) content.GetValueForProperty("DownloadProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressTotalBytesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressTotalBytesToDownload = (double?) content.GetValueForProperty("DownloadProgressTotalBytesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressTotalBytesToDownload, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressTotalBytesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressTotalBytesDownloaded = (double?) content.GetValueForProperty("DownloadProgressTotalBytesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressTotalBytesDownloaded, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressNumberOfUpdatesToDownload = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressNumberOfUpdatesToDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressNumberOfUpdatesDownloaded = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).DownloadProgressNumberOfUpdatesDownloaded, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgressPercentComplete = (int?) content.GetValueForProperty("InstallProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesToInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgressNumberOfUpdatesToInstall = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesToInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgressNumberOfUpdatesToInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesInstalled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgressNumberOfUpdatesInstalled = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesInstalled",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal)this).InstallProgressNumberOfUpdatesInstalled, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Job. + [System.ComponentModel.TypeConverter(typeof(JobTypeConverter))] + public partial interface IJob + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Job.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Job.TypeConverter.cs new file mode 100644 index 000000000000..bdf567fceec7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Job.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JobTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Job.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Job.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Job.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Job.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Job.cs new file mode 100644 index 000000000000..53f85c573ea9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Job.cs @@ -0,0 +1,531 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Job. + public partial class Job : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The time of the backup used for the failover. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime? BackupPointInTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).BackupPointInTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).BackupPointInTime = value ?? default(global::System.DateTime); } + + /// The code intended for programmatic access + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)Error).Code = value ?? null; } + + /// The device id in which the job is currently running + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DeviceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DeviceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DeviceId = value ?? null; } + + /// The download phase. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase? DownloadProgressDownloadPhase { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgressDownloadPhase; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgressDownloadPhase = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase)""); } + + /// Number of updates downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? DownloadProgressNumberOfUpdatesDownloaded { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgressNumberOfUpdatesDownloaded; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgressNumberOfUpdatesDownloaded = value ?? default(int); } + + /// Number of updates to download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? DownloadProgressNumberOfUpdatesToDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgressNumberOfUpdatesToDownload; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgressNumberOfUpdatesToDownload = value ?? default(int); } + + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? DownloadProgressPercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgressPercentComplete; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgressPercentComplete = value ?? default(int); } + + /// Total bytes downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public double? DownloadProgressTotalBytesDownloaded { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgressTotalBytesDownloaded; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgressTotalBytesDownloaded = value ?? default(double); } + + /// Total bytes to download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public double? DownloadProgressTotalBytesToDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgressTotalBytesToDownload; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgressTotalBytesToDownload = value ?? default(double); } + + /// Backing field for property. + private global::System.DateTime? _endTime; + + /// The UTC time at which the job completed + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? EndTime { get => this._endTime; set => this._endTime = value; } + + /// The entity identifier for which the job ran. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string EntityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).EntityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).EntityId = value ?? null; } + + /// The entity type for which the job ran. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string EntityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).EntityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).EntityType = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails _error; + + /// The Error details. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorDetails()); set => this._error = value; } + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem[] ErrorDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)Error).ErrorDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)Error).ErrorDetail = value ?? null /* arrayOf */; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Number of updates installed. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? InstallProgressNumberOfUpdatesInstalled { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).InstallProgressNumberOfUpdatesInstalled; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).InstallProgressNumberOfUpdatesInstalled = value ?? default(int); } + + /// Number of updates to install. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? InstallProgressNumberOfUpdatesToInstall { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).InstallProgressNumberOfUpdatesToInstall; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).InstallProgressNumberOfUpdatesToInstall = value ?? default(int); } + + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? InstallProgressPercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).InstallProgressPercentComplete; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).InstallProgressPercentComplete = value ?? default(int); } + + /// Represents whether the job is cancellable or not + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public bool? IsCancellable { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).IsCancellable; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).IsCancellable = value ?? default(bool); } + + /// Type of the job + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType? JobType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).JobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).JobType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType)""); } + + /// The message intended to describe the error in detail + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for DownloadProgress + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal.DownloadProgress { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgress; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).DownloadProgress = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorDetails()); set { {_error = value;} } } + + /// Internal Acessors for InstallProgress + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal.InstallProgress { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).InstallProgress; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).InstallProgress = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobProperties()); set { {_property = value;} } } + + /// Internal Acessors for Stat + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobInternal.Stat { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).Stat; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).Stat = value; } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private int _percentComplete; + + /// The percentage of the job that is already complete + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int PercentComplete { get => this._percentComplete; set => this._percentComplete = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties _property; + + /// Other properties of the job + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobProperties()); set => this._property = value; } + + /// The source device identifier of the failover job. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string SourceDeviceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).SourceDeviceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).SourceDeviceId = value ?? null; } + + /// The job stages. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage[] Stage { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).JobStage; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).JobStage = value ?? null /* arrayOf */; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// The UTC time at which the job was started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } + + /// Completed work item count. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? StatCompletedWorkItemCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).StatCompletedWorkItemCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).StatCompletedWorkItemCount = value ?? default(int); } + + /// The estimated time remaining. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? StatEstimatedTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).StatEstimatedTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).StatEstimatedTimeRemaining = value ?? default(int); } + + /// Total work item count. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? StatTotalWorkItemCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).StatTotalWorkItemCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).StatTotalWorkItemCount = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus _status; + + /// Current status of the job + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus Status { get => this._status; set => this._status = value; } + + /// Id of the object that is created by the job + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string TargetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).TargetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).TargetId = value ?? null; } + + /// The target type of the backup. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType? TargetType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).TargetType; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)Property).TargetType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType)""); } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public Job() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The Job. + public partial interface IJob : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// The time of the backup used for the failover. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time of the backup used for the failover.", + SerializedName = @"backupPointInTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BackupPointInTime { get; set; } + /// The code intended for programmatic access + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The code intended for programmatic access", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// The device id in which the job is currently running + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The device id in which the job is currently running", + SerializedName = @"deviceId", + PossibleTypes = new [] { typeof(string) })] + string DeviceId { get; set; } + /// The download phase. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The download phase.", + SerializedName = @"downloadPhase", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase? DownloadProgressDownloadPhase { get; set; } + /// Number of updates downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of updates downloaded.", + SerializedName = @"numberOfUpdatesDownloaded", + PossibleTypes = new [] { typeof(int) })] + int? DownloadProgressNumberOfUpdatesDownloaded { get; set; } + /// Number of updates to download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of updates to download.", + SerializedName = @"numberOfUpdatesToDownload", + PossibleTypes = new [] { typeof(int) })] + int? DownloadProgressNumberOfUpdatesToDownload { get; set; } + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Percentage of completion.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int? DownloadProgressPercentComplete { get; set; } + /// Total bytes downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total bytes downloaded.", + SerializedName = @"totalBytesDownloaded", + PossibleTypes = new [] { typeof(double) })] + double? DownloadProgressTotalBytesDownloaded { get; set; } + /// Total bytes to download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total bytes to download.", + SerializedName = @"totalBytesToDownload", + PossibleTypes = new [] { typeof(double) })] + double? DownloadProgressTotalBytesToDownload { get; set; } + /// The UTC time at which the job completed + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The UTC time at which the job completed", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndTime { get; set; } + /// The entity identifier for which the job ran. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The entity identifier for which the job ran.", + SerializedName = @"entityId", + PossibleTypes = new [] { typeof(string) })] + string EntityId { get; set; } + /// The entity type for which the job ran. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The entity type for which the job ran.", + SerializedName = @"entityType", + PossibleTypes = new [] { typeof(string) })] + string EntityType { get; set; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The error details.", + SerializedName = @"errorDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem[] ErrorDetail { get; set; } + /// Number of updates installed. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of updates installed.", + SerializedName = @"numberOfUpdatesInstalled", + PossibleTypes = new [] { typeof(int) })] + int? InstallProgressNumberOfUpdatesInstalled { get; set; } + /// Number of updates to install. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of updates to install.", + SerializedName = @"numberOfUpdatesToInstall", + PossibleTypes = new [] { typeof(int) })] + int? InstallProgressNumberOfUpdatesToInstall { get; set; } + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Percentage of completion.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int? InstallProgressPercentComplete { get; set; } + /// Represents whether the job is cancellable or not + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents whether the job is cancellable or not", + SerializedName = @"isCancellable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCancellable { get; set; } + /// Type of the job + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the job", + SerializedName = @"jobType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType? JobType { get; set; } + /// The message intended to describe the error in detail + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The message intended to describe the error in detail", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// The percentage of the job that is already complete + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The percentage of the job that is already complete", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int PercentComplete { get; set; } + /// The source device identifier of the failover job. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The source device identifier of the failover job.", + SerializedName = @"sourceDeviceId", + PossibleTypes = new [] { typeof(string) })] + string SourceDeviceId { get; set; } + /// The job stages. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The job stages.", + SerializedName = @"jobStages", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage[] Stage { get; set; } + /// The UTC time at which the job was started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The UTC time at which the job was started", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + /// Completed work item count. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Completed work item count.", + SerializedName = @"completedWorkItemCount", + PossibleTypes = new [] { typeof(int) })] + int? StatCompletedWorkItemCount { get; set; } + /// The estimated time remaining. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The estimated time remaining.", + SerializedName = @"estimatedTimeRemaining", + PossibleTypes = new [] { typeof(int) })] + int? StatEstimatedTimeRemaining { get; set; } + /// Total work item count. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total work item count.", + SerializedName = @"totalWorkItemCount", + PossibleTypes = new [] { typeof(int) })] + int? StatTotalWorkItemCount { get; set; } + /// Current status of the job + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Current status of the job", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus Status { get; set; } + /// Id of the object that is created by the job + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id of the object that is created by the job", + SerializedName = @"targetId", + PossibleTypes = new [] { typeof(string) })] + string TargetId { get; set; } + /// The target type of the backup. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The target type of the backup.", + SerializedName = @"targetType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType? TargetType { get; set; } + + } + /// The Job. + internal partial interface IJobInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The time of the backup used for the failover. + global::System.DateTime? BackupPointInTime { get; set; } + /// The code intended for programmatic access + string Code { get; set; } + /// The device id in which the job is currently running + string DeviceId { get; set; } + /// The download progress. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress DownloadProgress { get; set; } + /// The download phase. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase? DownloadProgressDownloadPhase { get; set; } + /// Number of updates downloaded. + int? DownloadProgressNumberOfUpdatesDownloaded { get; set; } + /// Number of updates to download. + int? DownloadProgressNumberOfUpdatesToDownload { get; set; } + /// Percentage of completion. + int? DownloadProgressPercentComplete { get; set; } + /// Total bytes downloaded. + double? DownloadProgressTotalBytesDownloaded { get; set; } + /// Total bytes to download. + double? DownloadProgressTotalBytesToDownload { get; set; } + /// The UTC time at which the job completed + global::System.DateTime? EndTime { get; set; } + /// The entity identifier for which the job ran. + string EntityId { get; set; } + /// The entity type for which the job ran. + string EntityType { get; set; } + /// The Error details. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails Error { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem[] ErrorDetail { get; set; } + /// The install progress. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress InstallProgress { get; set; } + /// Number of updates installed. + int? InstallProgressNumberOfUpdatesInstalled { get; set; } + /// Number of updates to install. + int? InstallProgressNumberOfUpdatesToInstall { get; set; } + /// Percentage of completion. + int? InstallProgressPercentComplete { get; set; } + /// Represents whether the job is cancellable or not + bool? IsCancellable { get; set; } + /// Type of the job + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType? JobType { get; set; } + /// The message intended to describe the error in detail + string Message { get; set; } + /// The percentage of the job that is already complete + int PercentComplete { get; set; } + /// Other properties of the job + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties Property { get; set; } + /// The source device identifier of the failover job. + string SourceDeviceId { get; set; } + /// The job stages. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage[] Stage { get; set; } + /// The UTC time at which the job was started + global::System.DateTime? StartTime { get; set; } + /// stats properties for the job + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats Stat { get; set; } + /// Completed work item count. + int? StatCompletedWorkItemCount { get; set; } + /// The estimated time remaining. + int? StatEstimatedTimeRemaining { get; set; } + /// Total work item count. + int? StatTotalWorkItemCount { get; set; } + /// Current status of the job + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus Status { get; set; } + /// Id of the object that is created by the job + string TargetId { get; set; } + /// The target type of the backup. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType? TargetType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Job.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Job.json.cs new file mode 100644 index 000000000000..4d68d88f9cfc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Job.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Job. + public partial class Job + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new Job(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal Job(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorDetails.FromJson(__jsonError) : Error;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobProperties.FromJson(__jsonProperties) : Property;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? global::System.DateTime.TryParse((string)__jsonEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndTimeValue) ? __jsonEndTimeValue : EndTime : EndTime;} + {_percentComplete = If( json?.PropertyT("percentComplete"), out var __jsonPercentComplete) ? (int)__jsonPercentComplete : PercentComplete;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + AddIf( null != this._endTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._endTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endTime" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber(this._percentComplete), "percentComplete" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorDetails.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorDetails.PowerShell.cs new file mode 100644 index 000000000000..c438a6bffccc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorDetails.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The job error information containing List of JobErrorItem. + [System.ComponentModel.TypeConverter(typeof(JobErrorDetailsTypeConverter))] + public partial class JobErrorDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JobErrorDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JobErrorDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JobErrorDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorItemTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JobErrorDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ErrorDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)this).ErrorDetail = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem[]) content.GetValueForProperty("ErrorDetail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)this).ErrorDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorItemTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The job error information containing List of JobErrorItem. + [System.ComponentModel.TypeConverter(typeof(JobErrorDetailsTypeConverter))] + public partial interface IJobErrorDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorDetails.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorDetails.TypeConverter.cs new file mode 100644 index 000000000000..7b79122b7070 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorDetails.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JobErrorDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JobErrorDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JobErrorDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JobErrorDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorDetails.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorDetails.cs new file mode 100644 index 000000000000..4df8098d1b1b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorDetails.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The job error information containing List of JobErrorItem. + public partial class JobErrorDetails : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetailsInternal + { + + /// Backing field for property. + private string _code; + + /// The code intended for programmatic access + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem[] _errorDetail; + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem[] ErrorDetail { get => this._errorDetail; set => this._errorDetail = value; } + + /// Backing field for property. + private string _message; + + /// The message intended to describe the error in detail + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Creates an new instance. + public JobErrorDetails() + { + + } + } + /// The job error information containing List of JobErrorItem. + public partial interface IJobErrorDetails : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The code intended for programmatic access + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The code intended for programmatic access", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The error details.", + SerializedName = @"errorDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem[] ErrorDetail { get; set; } + /// The message intended to describe the error in detail + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The message intended to describe the error in detail", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// The job error information containing List of JobErrorItem. + internal partial interface IJobErrorDetailsInternal + + { + /// The code intended for programmatic access + string Code { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem[] ErrorDetail { get; set; } + /// The message intended to describe the error in detail + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorDetails.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorDetails.json.cs new file mode 100644 index 000000000000..634d6fcf42ee --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorDetails.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The job error information containing List of JobErrorItem. + public partial class JobErrorDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new JobErrorDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal JobErrorDetails(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_errorDetail = If( json?.PropertyT("errorDetails"), out var __jsonErrorDetails) ? If( __jsonErrorDetails as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobErrorItem.FromJson(__u) )) ))() : null : ErrorDetail;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._errorDetail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._errorDetail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("errorDetails",__w); + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorItem.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorItem.PowerShell.cs new file mode 100644 index 000000000000..0eed5d994f44 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorItem.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The job error items. + [System.ComponentModel.TypeConverter(typeof(JobErrorItemTypeConverter))] + public partial class JobErrorItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JobErrorItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JobErrorItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JobErrorItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItemInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItemInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItemInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItemInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItemInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItemInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JobErrorItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Recommendation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItemInternal)this).Recommendation = (string[]) content.GetValueForProperty("Recommendation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItemInternal)this).Recommendation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItemInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItemInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItemInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItemInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The job error items. + [System.ComponentModel.TypeConverter(typeof(JobErrorItemTypeConverter))] + public partial interface IJobErrorItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorItem.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorItem.TypeConverter.cs new file mode 100644 index 000000000000..1f18e5a47745 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorItem.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JobErrorItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JobErrorItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JobErrorItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JobErrorItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorItem.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorItem.cs new file mode 100644 index 000000000000..3ca82d12c67a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorItem.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The job error items. + public partial class JobErrorItem : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItemInternal + { + + /// Backing field for property. + private string _code; + + /// The code intended for programmatic access + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private string _message; + + /// The message intended to describe the error in detail + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Backing field for property. + private string[] _recommendation; + + /// The recommended actions. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string[] Recommendation { get => this._recommendation; set => this._recommendation = value; } + + /// Creates an new instance. + public JobErrorItem() + { + + } + } + /// The job error items. + public partial interface IJobErrorItem : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The code intended for programmatic access + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The code intended for programmatic access", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// The message intended to describe the error in detail + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The message intended to describe the error in detail", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// The recommended actions. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The recommended actions.", + SerializedName = @"recommendations", + PossibleTypes = new [] { typeof(string) })] + string[] Recommendation { get; set; } + + } + /// The job error items. + internal partial interface IJobErrorItemInternal + + { + /// The code intended for programmatic access + string Code { get; set; } + /// The message intended to describe the error in detail + string Message { get; set; } + /// The recommended actions. + string[] Recommendation { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorItem.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorItem.json.cs new file mode 100644 index 000000000000..a6dbbc47195d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobErrorItem.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The job error items. + public partial class JobErrorItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobErrorItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new JobErrorItem(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal JobErrorItem(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_recommendation = If( json?.PropertyT("recommendations"), out var __jsonRecommendations) ? If( __jsonRecommendations as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Recommendation;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._recommendation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._recommendation ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("recommendations",__w); + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobFilter.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobFilter.PowerShell.cs new file mode 100644 index 000000000000..595a27f7c1d5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Filters that can be specified for the job + [System.ComponentModel.TypeConverter(typeof(JobFilterTypeConverter))] + public partial class JobFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JobFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JobFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JobFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilterInternal)this).JobType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilterInternal)this).JobType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType.CreateFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilterInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilterInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus.CreateFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilterInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilterInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JobFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilterInternal)this).JobType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilterInternal)this).JobType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType.CreateFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilterInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilterInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus.CreateFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilterInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilterInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Filters that can be specified for the job + [System.ComponentModel.TypeConverter(typeof(JobFilterTypeConverter))] + public partial interface IJobFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobFilter.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobFilter.TypeConverter.cs new file mode 100644 index 000000000000..abab86104ba2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobFilter.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JobFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JobFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JobFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JobFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobFilter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobFilter.cs new file mode 100644 index 000000000000..4c07b489a4a3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobFilter.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Filters that can be specified for the job + public partial class JobFilter : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilter, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilterInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType _jobType; + + /// The job type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType JobType { get => this._jobType; set => this._jobType = value; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// The start time of the job. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus _status; + + /// The job status. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public JobFilter() + { + + } + } + /// Filters that can be specified for the job + public partial interface IJobFilter : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The job type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The job type.", + SerializedName = @"jobType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType JobType { get; set; } + /// The start time of the job. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start time of the job.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + /// The job status. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The job status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus Status { get; set; } + + } + /// Filters that can be specified for the job + internal partial interface IJobFilterInternal + + { + /// The job type. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType JobType { get; set; } + /// The start time of the job. + global::System.DateTime? StartTime { get; set; } + /// The job status. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobFilter.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobFilter.json.cs new file mode 100644 index 000000000000..db9c70e3f665 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobFilter.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Filters that can be specified for the job + public partial class JobFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new JobFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal JobFilter(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_jobType = If( json?.PropertyT("jobType"), out var __jsonJobType) ? (string)__jsonJobType : (string)JobType;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._jobType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._jobType.ToString()) : null, "jobType" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobList.PowerShell.cs new file mode 100644 index 000000000000..e9db4f48eec3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobList.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Collection of jobs + [System.ComponentModel.TypeConverter(typeof(JobListTypeConverter))] + public partial class JobList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JobList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JobList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JobList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JobList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of jobs + [System.ComponentModel.TypeConverter(typeof(JobListTypeConverter))] + public partial interface IJobList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobList.TypeConverter.cs new file mode 100644 index 000000000000..417a5e9fcaa6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobList.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JobListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JobList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JobList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JobList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobList.cs new file mode 100644 index 000000000000..a16261668a76 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobList.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of jobs + public partial class JobList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The NextLink. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public JobList() + { + + } + } + /// Collection of jobs + public partial interface IJobList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The NextLink. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The NextLink.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob[] Value { get; set; } + + } + /// Collection of jobs + internal partial interface IJobListInternal + + { + /// The NextLink. + string NextLink { get; set; } + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobList.json.cs new file mode 100644 index 000000000000..d4e7c2652152 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobList.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of jobs + public partial class JobList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new JobList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal JobList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Job.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobProperties.PowerShell.cs new file mode 100644 index 000000000000..8e7aaacaf54b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobProperties.PowerShell.cs @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// properties for the job + [System.ComponentModel.TypeConverter(typeof(JobPropertiesTypeConverter))] + public partial class JobProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JobProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JobProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JobProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Stat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).Stat = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats) content.GetValueForProperty("Stat",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).Stat, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStatsTypeConverter.ConvertFrom); + } + if (content.Contains("DownloadProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgress = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress) content.GetValueForProperty("DownloadProgress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgress, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateDownloadProgressTypeConverter.ConvertFrom); + } + if (content.Contains("InstallProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgress = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress) content.GetValueForProperty("InstallProgress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgress, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateInstallProgressTypeConverter.ConvertFrom); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).JobType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).JobType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType.CreateFrom); + } + if (content.Contains("TargetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).TargetId, global::System.Convert.ToString); + } + if (content.Contains("EntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).EntityId = (string) content.GetValueForProperty("EntityId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).EntityId, global::System.Convert.ToString); + } + if (content.Contains("EntityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).EntityType = (string) content.GetValueForProperty("EntityType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).EntityType, global::System.Convert.ToString); + } + if (content.Contains("JobStage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).JobStage = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage[]) content.GetValueForProperty("JobStage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).JobStage, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStageTypeConverter.ConvertFrom)); + } + if (content.Contains("DeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DeviceId = (string) content.GetValueForProperty("DeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DeviceId, global::System.Convert.ToString); + } + if (content.Contains("IsCancellable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).IsCancellable = (bool?) content.GetValueForProperty("IsCancellable",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).IsCancellable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).TargetType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType?) content.GetValueForProperty("TargetType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).TargetType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType.CreateFrom); + } + if (content.Contains("SourceDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).SourceDeviceId = (string) content.GetValueForProperty("SourceDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).SourceDeviceId, global::System.Convert.ToString); + } + if (content.Contains("BackupPointInTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).BackupPointInTime = (global::System.DateTime?) content.GetValueForProperty("BackupPointInTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).BackupPointInTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DownloadProgressDownloadPhase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressDownloadPhase = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase?) content.GetValueForProperty("DownloadProgressDownloadPhase",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressDownloadPhase, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase.CreateFrom); + } + if (content.Contains("StatCompletedWorkItemCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).StatCompletedWorkItemCount = (int?) content.GetValueForProperty("StatCompletedWorkItemCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).StatCompletedWorkItemCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StatTotalWorkItemCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).StatTotalWorkItemCount = (int?) content.GetValueForProperty("StatTotalWorkItemCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).StatTotalWorkItemCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StatEstimatedTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).StatEstimatedTimeRemaining = (int?) content.GetValueForProperty("StatEstimatedTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).StatEstimatedTimeRemaining, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressPercentComplete = (int?) content.GetValueForProperty("DownloadProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressTotalBytesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressTotalBytesToDownload = (double?) content.GetValueForProperty("DownloadProgressTotalBytesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressTotalBytesToDownload, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressTotalBytesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressTotalBytesDownloaded = (double?) content.GetValueForProperty("DownloadProgressTotalBytesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressTotalBytesDownloaded, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesToDownload = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesToDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesDownloaded = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesDownloaded, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgressPercentComplete = (int?) content.GetValueForProperty("InstallProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesToInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesToInstall = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesToInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesToInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesInstalled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesInstalled = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesInstalled",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesInstalled, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JobProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Stat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).Stat = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats) content.GetValueForProperty("Stat",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).Stat, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStatsTypeConverter.ConvertFrom); + } + if (content.Contains("DownloadProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgress = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress) content.GetValueForProperty("DownloadProgress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgress, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateDownloadProgressTypeConverter.ConvertFrom); + } + if (content.Contains("InstallProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgress = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress) content.GetValueForProperty("InstallProgress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgress, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateInstallProgressTypeConverter.ConvertFrom); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).JobType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).JobType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType.CreateFrom); + } + if (content.Contains("TargetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).TargetId, global::System.Convert.ToString); + } + if (content.Contains("EntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).EntityId = (string) content.GetValueForProperty("EntityId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).EntityId, global::System.Convert.ToString); + } + if (content.Contains("EntityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).EntityType = (string) content.GetValueForProperty("EntityType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).EntityType, global::System.Convert.ToString); + } + if (content.Contains("JobStage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).JobStage = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage[]) content.GetValueForProperty("JobStage",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).JobStage, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStageTypeConverter.ConvertFrom)); + } + if (content.Contains("DeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DeviceId = (string) content.GetValueForProperty("DeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DeviceId, global::System.Convert.ToString); + } + if (content.Contains("IsCancellable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).IsCancellable = (bool?) content.GetValueForProperty("IsCancellable",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).IsCancellable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).TargetType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType?) content.GetValueForProperty("TargetType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).TargetType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType.CreateFrom); + } + if (content.Contains("SourceDeviceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).SourceDeviceId = (string) content.GetValueForProperty("SourceDeviceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).SourceDeviceId, global::System.Convert.ToString); + } + if (content.Contains("BackupPointInTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).BackupPointInTime = (global::System.DateTime?) content.GetValueForProperty("BackupPointInTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).BackupPointInTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DownloadProgressDownloadPhase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressDownloadPhase = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase?) content.GetValueForProperty("DownloadProgressDownloadPhase",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressDownloadPhase, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase.CreateFrom); + } + if (content.Contains("StatCompletedWorkItemCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).StatCompletedWorkItemCount = (int?) content.GetValueForProperty("StatCompletedWorkItemCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).StatCompletedWorkItemCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StatTotalWorkItemCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).StatTotalWorkItemCount = (int?) content.GetValueForProperty("StatTotalWorkItemCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).StatTotalWorkItemCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StatEstimatedTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).StatEstimatedTimeRemaining = (int?) content.GetValueForProperty("StatEstimatedTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).StatEstimatedTimeRemaining, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressPercentComplete = (int?) content.GetValueForProperty("DownloadProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressTotalBytesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressTotalBytesToDownload = (double?) content.GetValueForProperty("DownloadProgressTotalBytesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressTotalBytesToDownload, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressTotalBytesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressTotalBytesDownloaded = (double?) content.GetValueForProperty("DownloadProgressTotalBytesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressTotalBytesDownloaded, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesToDownload = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesToDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DownloadProgressNumberOfUpdatesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesDownloaded = (int?) content.GetValueForProperty("DownloadProgressNumberOfUpdatesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).DownloadProgressNumberOfUpdatesDownloaded, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressPercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgressPercentComplete = (int?) content.GetValueForProperty("InstallProgressPercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgressPercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesToInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesToInstall = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesToInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesToInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("InstallProgressNumberOfUpdatesInstalled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesInstalled = (int?) content.GetValueForProperty("InstallProgressNumberOfUpdatesInstalled",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal)this).InstallProgressNumberOfUpdatesInstalled, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// properties for the job + [System.ComponentModel.TypeConverter(typeof(JobPropertiesTypeConverter))] + public partial interface IJobProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobProperties.TypeConverter.cs new file mode 100644 index 000000000000..5d0ed74ff877 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JobPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JobProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JobProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JobProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobProperties.cs new file mode 100644 index 000000000000..a17cba241f9f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobProperties.cs @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// properties for the job + public partial class JobProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime? _backupPointInTime; + + /// The time of the backup used for the failover. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? BackupPointInTime { get => this._backupPointInTime; set => this._backupPointInTime = value; } + + /// Backing field for property. + private string _deviceId; + + /// The device id in which the job is currently running + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string DeviceId { get => this._deviceId; set => this._deviceId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress _downloadProgress; + + /// The download progress. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress DownloadProgress { get => (this._downloadProgress = this._downloadProgress ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateDownloadProgress()); set => this._downloadProgress = value; } + + /// The download phase. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase? DownloadProgressDownloadPhase { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)DownloadProgress).DownloadPhase; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)DownloadProgress).DownloadPhase = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase)""); } + + /// Number of updates downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? DownloadProgressNumberOfUpdatesDownloaded { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)DownloadProgress).NumberOfUpdatesDownloaded; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)DownloadProgress).NumberOfUpdatesDownloaded = value ?? default(int); } + + /// Number of updates to download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? DownloadProgressNumberOfUpdatesToDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)DownloadProgress).NumberOfUpdatesToDownload; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)DownloadProgress).NumberOfUpdatesToDownload = value ?? default(int); } + + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? DownloadProgressPercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)DownloadProgress).PercentComplete; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)DownloadProgress).PercentComplete = value ?? default(int); } + + /// Total bytes downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public double? DownloadProgressTotalBytesDownloaded { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)DownloadProgress).TotalBytesDownloaded; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)DownloadProgress).TotalBytesDownloaded = value ?? default(double); } + + /// Total bytes to download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public double? DownloadProgressTotalBytesToDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)DownloadProgress).TotalBytesToDownload; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)DownloadProgress).TotalBytesToDownload = value ?? default(double); } + + /// Backing field for property. + private string _entityId; + + /// The entity identifier for which the job ran. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string EntityId { get => this._entityId; set => this._entityId = value; } + + /// Backing field for property. + private string _entityType; + + /// The entity type for which the job ran. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string EntityType { get => this._entityType; set => this._entityType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress _installProgress; + + /// The install progress. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress InstallProgress { get => (this._installProgress = this._installProgress ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateInstallProgress()); set => this._installProgress = value; } + + /// Number of updates installed. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? InstallProgressNumberOfUpdatesInstalled { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)InstallProgress).NumberOfUpdatesInstalled; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)InstallProgress).NumberOfUpdatesInstalled = value ?? default(int); } + + /// Number of updates to install. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? InstallProgressNumberOfUpdatesToInstall { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)InstallProgress).NumberOfUpdatesToInstall; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)InstallProgress).NumberOfUpdatesToInstall = value ?? default(int); } + + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? InstallProgressPercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)InstallProgress).PercentComplete; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)InstallProgress).PercentComplete = value ?? default(int); } + + /// Backing field for property. + private bool? _isCancellable; + + /// Represents whether the job is cancellable or not + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public bool? IsCancellable { get => this._isCancellable; set => this._isCancellable = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage[] _jobStage; + + /// The job stages. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage[] JobStage { get => this._jobStage; set => this._jobStage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType _jobType; + + /// Type of the job + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType JobType { get => this._jobType; set => this._jobType = value; } + + /// Internal Acessors for DownloadProgress + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal.DownloadProgress { get => (this._downloadProgress = this._downloadProgress ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateDownloadProgress()); set { {_downloadProgress = value;} } } + + /// Internal Acessors for InstallProgress + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal.InstallProgress { get => (this._installProgress = this._installProgress ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateInstallProgress()); set { {_installProgress = value;} } } + + /// Internal Acessors for Stat + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobPropertiesInternal.Stat { get => (this._stat = this._stat ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStats()); set { {_stat = value;} } } + + /// Backing field for property. + private string _sourceDeviceId; + + /// The source device identifier of the failover job. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string SourceDeviceId { get => this._sourceDeviceId; set => this._sourceDeviceId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats _stat; + + /// stats properties for the job + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats Stat { get => (this._stat = this._stat ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStats()); set => this._stat = value; } + + /// Completed work item count. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? StatCompletedWorkItemCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)Stat).CompletedWorkItemCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)Stat).CompletedWorkItemCount = value ?? default(int); } + + /// The estimated time remaining. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? StatEstimatedTimeRemaining { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)Stat).EstimatedTimeRemaining; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)Stat).EstimatedTimeRemaining = value ?? default(int); } + + /// Total work item count. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? StatTotalWorkItemCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)Stat).TotalWorkItemCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)Stat).TotalWorkItemCount = value ?? default(int); } + + /// Backing field for property. + private string _targetId; + + /// Id of the object that is created by the job + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string TargetId { get => this._targetId; set => this._targetId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType? _targetType; + + /// The target type of the backup. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType? TargetType { get => this._targetType; set => this._targetType = value; } + + /// Creates an new instance. + public JobProperties() + { + + } + } + /// properties for the job + public partial interface IJobProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The time of the backup used for the failover. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time of the backup used for the failover.", + SerializedName = @"backupPointInTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BackupPointInTime { get; set; } + /// The device id in which the job is currently running + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The device id in which the job is currently running", + SerializedName = @"deviceId", + PossibleTypes = new [] { typeof(string) })] + string DeviceId { get; set; } + /// The download phase. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The download phase.", + SerializedName = @"downloadPhase", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase? DownloadProgressDownloadPhase { get; set; } + /// Number of updates downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of updates downloaded.", + SerializedName = @"numberOfUpdatesDownloaded", + PossibleTypes = new [] { typeof(int) })] + int? DownloadProgressNumberOfUpdatesDownloaded { get; set; } + /// Number of updates to download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of updates to download.", + SerializedName = @"numberOfUpdatesToDownload", + PossibleTypes = new [] { typeof(int) })] + int? DownloadProgressNumberOfUpdatesToDownload { get; set; } + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Percentage of completion.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int? DownloadProgressPercentComplete { get; set; } + /// Total bytes downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total bytes downloaded.", + SerializedName = @"totalBytesDownloaded", + PossibleTypes = new [] { typeof(double) })] + double? DownloadProgressTotalBytesDownloaded { get; set; } + /// Total bytes to download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total bytes to download.", + SerializedName = @"totalBytesToDownload", + PossibleTypes = new [] { typeof(double) })] + double? DownloadProgressTotalBytesToDownload { get; set; } + /// The entity identifier for which the job ran. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The entity identifier for which the job ran.", + SerializedName = @"entityId", + PossibleTypes = new [] { typeof(string) })] + string EntityId { get; set; } + /// The entity type for which the job ran. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The entity type for which the job ran.", + SerializedName = @"entityType", + PossibleTypes = new [] { typeof(string) })] + string EntityType { get; set; } + /// Number of updates installed. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of updates installed.", + SerializedName = @"numberOfUpdatesInstalled", + PossibleTypes = new [] { typeof(int) })] + int? InstallProgressNumberOfUpdatesInstalled { get; set; } + /// Number of updates to install. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of updates to install.", + SerializedName = @"numberOfUpdatesToInstall", + PossibleTypes = new [] { typeof(int) })] + int? InstallProgressNumberOfUpdatesToInstall { get; set; } + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Percentage of completion.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int? InstallProgressPercentComplete { get; set; } + /// Represents whether the job is cancellable or not + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents whether the job is cancellable or not", + SerializedName = @"isCancellable", + PossibleTypes = new [] { typeof(bool) })] + bool? IsCancellable { get; set; } + /// The job stages. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The job stages.", + SerializedName = @"jobStages", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage[] JobStage { get; set; } + /// Type of the job + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Type of the job", + SerializedName = @"jobType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType JobType { get; set; } + /// The source device identifier of the failover job. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The source device identifier of the failover job.", + SerializedName = @"sourceDeviceId", + PossibleTypes = new [] { typeof(string) })] + string SourceDeviceId { get; set; } + /// Completed work item count. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Completed work item count.", + SerializedName = @"completedWorkItemCount", + PossibleTypes = new [] { typeof(int) })] + int? StatCompletedWorkItemCount { get; set; } + /// The estimated time remaining. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The estimated time remaining.", + SerializedName = @"estimatedTimeRemaining", + PossibleTypes = new [] { typeof(int) })] + int? StatEstimatedTimeRemaining { get; set; } + /// Total work item count. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total work item count.", + SerializedName = @"totalWorkItemCount", + PossibleTypes = new [] { typeof(int) })] + int? StatTotalWorkItemCount { get; set; } + /// Id of the object that is created by the job + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id of the object that is created by the job", + SerializedName = @"targetId", + PossibleTypes = new [] { typeof(string) })] + string TargetId { get; set; } + /// The target type of the backup. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The target type of the backup.", + SerializedName = @"targetType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType? TargetType { get; set; } + + } + /// properties for the job + internal partial interface IJobPropertiesInternal + + { + /// The time of the backup used for the failover. + global::System.DateTime? BackupPointInTime { get; set; } + /// The device id in which the job is currently running + string DeviceId { get; set; } + /// The download progress. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress DownloadProgress { get; set; } + /// The download phase. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase? DownloadProgressDownloadPhase { get; set; } + /// Number of updates downloaded. + int? DownloadProgressNumberOfUpdatesDownloaded { get; set; } + /// Number of updates to download. + int? DownloadProgressNumberOfUpdatesToDownload { get; set; } + /// Percentage of completion. + int? DownloadProgressPercentComplete { get; set; } + /// Total bytes downloaded. + double? DownloadProgressTotalBytesDownloaded { get; set; } + /// Total bytes to download. + double? DownloadProgressTotalBytesToDownload { get; set; } + /// The entity identifier for which the job ran. + string EntityId { get; set; } + /// The entity type for which the job ran. + string EntityType { get; set; } + /// The install progress. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress InstallProgress { get; set; } + /// Number of updates installed. + int? InstallProgressNumberOfUpdatesInstalled { get; set; } + /// Number of updates to install. + int? InstallProgressNumberOfUpdatesToInstall { get; set; } + /// Percentage of completion. + int? InstallProgressPercentComplete { get; set; } + /// Represents whether the job is cancellable or not + bool? IsCancellable { get; set; } + /// The job stages. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage[] JobStage { get; set; } + /// Type of the job + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType JobType { get; set; } + /// The source device identifier of the failover job. + string SourceDeviceId { get; set; } + /// stats properties for the job + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats Stat { get; set; } + /// Completed work item count. + int? StatCompletedWorkItemCount { get; set; } + /// The estimated time remaining. + int? StatEstimatedTimeRemaining { get; set; } + /// Total work item count. + int? StatTotalWorkItemCount { get; set; } + /// Id of the object that is created by the job + string TargetId { get; set; } + /// The target type of the backup. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType? TargetType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobProperties.json.cs new file mode 100644 index 000000000000..8646b1db42bb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobProperties.json.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// properties for the job + public partial class JobProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new JobProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal JobProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_stat = If( json?.PropertyT("stats"), out var __jsonStats) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStats.FromJson(__jsonStats) : Stat;} + {_downloadProgress = If( json?.PropertyT("downloadProgress"), out var __jsonDownloadProgress) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateDownloadProgress.FromJson(__jsonDownloadProgress) : DownloadProgress;} + {_installProgress = If( json?.PropertyT("installProgress"), out var __jsonInstallProgress) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdateInstallProgress.FromJson(__jsonInstallProgress) : InstallProgress;} + {_jobType = If( json?.PropertyT("jobType"), out var __jsonJobType) ? (string)__jsonJobType : (string)JobType;} + {_targetId = If( json?.PropertyT("targetId"), out var __jsonTargetId) ? (string)__jsonTargetId : (string)TargetId;} + {_entityId = If( json?.PropertyT("entityId"), out var __jsonEntityId) ? (string)__jsonEntityId : (string)EntityId;} + {_entityType = If( json?.PropertyT("entityType"), out var __jsonEntityType) ? (string)__jsonEntityType : (string)EntityType;} + {_jobStage = If( json?.PropertyT("jobStages"), out var __jsonJobStages) ? If( __jsonJobStages as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobStage.FromJson(__u) )) ))() : null : JobStage;} + {_deviceId = If( json?.PropertyT("deviceId"), out var __jsonDeviceId) ? (string)__jsonDeviceId : (string)DeviceId;} + {_isCancellable = If( json?.PropertyT("isCancellable"), out var __jsonIsCancellable) ? (bool?)__jsonIsCancellable : IsCancellable;} + {_targetType = If( json?.PropertyT("targetType"), out var __jsonTargetType) ? (string)__jsonTargetType : (string)TargetType;} + {_sourceDeviceId = If( json?.PropertyT("sourceDeviceId"), out var __jsonSourceDeviceId) ? (string)__jsonSourceDeviceId : (string)SourceDeviceId;} + {_backupPointInTime = If( json?.PropertyT("backupPointInTime"), out var __jsonBackupPointInTime) ? global::System.DateTime.TryParse((string)__jsonBackupPointInTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBackupPointInTimeValue) ? __jsonBackupPointInTimeValue : BackupPointInTime : BackupPointInTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._stat ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._stat.ToJson(null,serializationMode) : null, "stats" ,container.Add ); + AddIf( null != this._downloadProgress ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._downloadProgress.ToJson(null,serializationMode) : null, "downloadProgress" ,container.Add ); + AddIf( null != this._installProgress ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._installProgress.ToJson(null,serializationMode) : null, "installProgress" ,container.Add ); + AddIf( null != (((object)this._jobType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._jobType.ToString()) : null, "jobType" ,container.Add ); + AddIf( null != (((object)this._targetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._targetId.ToString()) : null, "targetId" ,container.Add ); + AddIf( null != (((object)this._entityId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._entityId.ToString()) : null, "entityId" ,container.Add ); + AddIf( null != (((object)this._entityType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._entityType.ToString()) : null, "entityType" ,container.Add ); + if (null != this._jobStage) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._jobStage ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("jobStages",__w); + } + AddIf( null != (((object)this._deviceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._deviceId.ToString()) : null, "deviceId" ,container.Add ); + AddIf( null != this._isCancellable ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonBoolean((bool)this._isCancellable) : null, "isCancellable" ,container.Add ); + AddIf( null != (((object)this._targetType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._targetType.ToString()) : null, "targetType" ,container.Add ); + AddIf( null != (((object)this._sourceDeviceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._sourceDeviceId.ToString()) : null, "sourceDeviceId" ,container.Add ); + AddIf( null != this._backupPointInTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._backupPointInTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "backupPointInTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStage.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStage.PowerShell.cs new file mode 100644 index 000000000000..94f99b6733b0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStage.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Contains details about the multiple job stages of a job + [System.ComponentModel.TypeConverter(typeof(JobStageTypeConverter))] + public partial class JobStage + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JobStage(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JobStage(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JobStage(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("StageStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).StageStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus) content.GetValueForProperty("StageStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).StageStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus.CreateFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).Detail = (string) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).Detail, global::System.Convert.ToString); + } + if (content.Contains("ErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).ErrorCode = (string) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).ErrorCode, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JobStage(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("StageStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).StageStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus) content.GetValueForProperty("StageStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).StageStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus.CreateFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).Detail = (string) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).Detail, global::System.Convert.ToString); + } + if (content.Contains("ErrorCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).ErrorCode = (string) content.GetValueForProperty("ErrorCode",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal)this).ErrorCode, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Contains details about the multiple job stages of a job + [System.ComponentModel.TypeConverter(typeof(JobStageTypeConverter))] + public partial interface IJobStage + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStage.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStage.TypeConverter.cs new file mode 100644 index 000000000000..11b02008fbc9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStage.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JobStageTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JobStage.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JobStage.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JobStage.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStage.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStage.cs new file mode 100644 index 000000000000..898b40e369ab --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStage.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Contains details about the multiple job stages of a job + public partial class JobStage : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStageInternal + { + + /// Backing field for property. + private string _detail; + + /// The details of the stage. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Detail { get => this._detail; set => this._detail = value; } + + /// Backing field for property. + private string _errorCode; + + /// The error code of the stage if any. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ErrorCode { get => this._errorCode; set => this._errorCode = value; } + + /// Backing field for property. + private string _message; + + /// The message of the job stage. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus _stageStatus; + + /// The stage status. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus StageStatus { get => this._stageStatus; set => this._stageStatus = value; } + + /// Creates an new instance. + public JobStage() + { + + } + } + /// Contains details about the multiple job stages of a job + public partial interface IJobStage : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The details of the stage. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The details of the stage.", + SerializedName = @"detail", + PossibleTypes = new [] { typeof(string) })] + string Detail { get; set; } + /// The error code of the stage if any. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The error code of the stage if any.", + SerializedName = @"errorCode", + PossibleTypes = new [] { typeof(string) })] + string ErrorCode { get; set; } + /// The message of the job stage. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The message of the job stage.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// The stage status. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The stage status.", + SerializedName = @"stageStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus StageStatus { get; set; } + + } + /// Contains details about the multiple job stages of a job + internal partial interface IJobStageInternal + + { + /// The details of the stage. + string Detail { get; set; } + /// The error code of the stage if any. + string ErrorCode { get; set; } + /// The message of the job stage. + string Message { get; set; } + /// The stage status. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus StageStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStage.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStage.json.cs new file mode 100644 index 000000000000..0efb9c287e22 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStage.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Contains details about the multiple job stages of a job + public partial class JobStage + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStage FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new JobStage(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal JobStage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_stageStatus = If( json?.PropertyT("stageStatus"), out var __jsonStageStatus) ? (string)__jsonStageStatus : (string)StageStatus;} + {_detail = If( json?.PropertyT("detail"), out var __jsonDetail) ? (string)__jsonDetail : (string)Detail;} + {_errorCode = If( json?.PropertyT("errorCode"), out var __jsonErrorCode) ? (string)__jsonErrorCode : (string)ErrorCode;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AddIf( null != (((object)this._stageStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._stageStatus.ToString()) : null, "stageStatus" ,container.Add ); + AddIf( null != (((object)this._detail)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._detail.ToString()) : null, "detail" ,container.Add ); + AddIf( null != (((object)this._errorCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._errorCode.ToString()) : null, "errorCode" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStats.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStats.PowerShell.cs new file mode 100644 index 000000000000..cb0a8ae18983 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStats.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Stats that are available for all jobs in common + [System.ComponentModel.TypeConverter(typeof(JobStatsTypeConverter))] + public partial class JobStats + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JobStats(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JobStats(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JobStats(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CompletedWorkItemCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)this).CompletedWorkItemCount = (int?) content.GetValueForProperty("CompletedWorkItemCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)this).CompletedWorkItemCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalWorkItemCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)this).TotalWorkItemCount = (int?) content.GetValueForProperty("TotalWorkItemCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)this).TotalWorkItemCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EstimatedTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)this).EstimatedTimeRemaining = (int?) content.GetValueForProperty("EstimatedTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)this).EstimatedTimeRemaining, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JobStats(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CompletedWorkItemCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)this).CompletedWorkItemCount = (int?) content.GetValueForProperty("CompletedWorkItemCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)this).CompletedWorkItemCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalWorkItemCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)this).TotalWorkItemCount = (int?) content.GetValueForProperty("TotalWorkItemCount",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)this).TotalWorkItemCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EstimatedTimeRemaining")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)this).EstimatedTimeRemaining = (int?) content.GetValueForProperty("EstimatedTimeRemaining",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal)this).EstimatedTimeRemaining, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Stats that are available for all jobs in common + [System.ComponentModel.TypeConverter(typeof(JobStatsTypeConverter))] + public partial interface IJobStats + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStats.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStats.TypeConverter.cs new file mode 100644 index 000000000000..7730ce2392d7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStats.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class JobStatsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return JobStats.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return JobStats.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return JobStats.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStats.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStats.cs new file mode 100644 index 000000000000..d3ce4d237238 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStats.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Stats that are available for all jobs in common + public partial class JobStats : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStatsInternal + { + + /// Backing field for property. + private int? _completedWorkItemCount; + + /// Completed work item count. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? CompletedWorkItemCount { get => this._completedWorkItemCount; set => this._completedWorkItemCount = value; } + + /// Backing field for property. + private int? _estimatedTimeRemaining; + + /// The estimated time remaining. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? EstimatedTimeRemaining { get => this._estimatedTimeRemaining; set => this._estimatedTimeRemaining = value; } + + /// Backing field for property. + private int? _totalWorkItemCount; + + /// Total work item count. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? TotalWorkItemCount { get => this._totalWorkItemCount; set => this._totalWorkItemCount = value; } + + /// Creates an new instance. + public JobStats() + { + + } + } + /// Stats that are available for all jobs in common + public partial interface IJobStats : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Completed work item count. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Completed work item count.", + SerializedName = @"completedWorkItemCount", + PossibleTypes = new [] { typeof(int) })] + int? CompletedWorkItemCount { get; set; } + /// The estimated time remaining. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The estimated time remaining.", + SerializedName = @"estimatedTimeRemaining", + PossibleTypes = new [] { typeof(int) })] + int? EstimatedTimeRemaining { get; set; } + /// Total work item count. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total work item count.", + SerializedName = @"totalWorkItemCount", + PossibleTypes = new [] { typeof(int) })] + int? TotalWorkItemCount { get; set; } + + } + /// Stats that are available for all jobs in common + internal partial interface IJobStatsInternal + + { + /// Completed work item count. + int? CompletedWorkItemCount { get; set; } + /// The estimated time remaining. + int? EstimatedTimeRemaining { get; set; } + /// Total work item count. + int? TotalWorkItemCount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStats.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStats.json.cs new file mode 100644 index 000000000000..3ac999053fd2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/JobStats.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Stats that are available for all jobs in common + public partial class JobStats + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobStats FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new JobStats(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal JobStats(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_completedWorkItemCount = If( json?.PropertyT("completedWorkItemCount"), out var __jsonCompletedWorkItemCount) ? (int?)__jsonCompletedWorkItemCount : CompletedWorkItemCount;} + {_totalWorkItemCount = If( json?.PropertyT("totalWorkItemCount"), out var __jsonTotalWorkItemCount) ? (int?)__jsonTotalWorkItemCount : TotalWorkItemCount;} + {_estimatedTimeRemaining = If( json?.PropertyT("estimatedTimeRemaining"), out var __jsonEstimatedTimeRemaining) ? (int?)__jsonEstimatedTimeRemaining : EstimatedTimeRemaining;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._completedWorkItemCount ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._completedWorkItemCount) : null, "completedWorkItemCount" ,container.Add ); + AddIf( null != this._totalWorkItemCount ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._totalWorkItemCount) : null, "totalWorkItemCount" ,container.Add ); + AddIf( null != this._estimatedTimeRemaining ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._estimatedTimeRemaining) : null, "estimatedTimeRemaining" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Manager.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Manager.PowerShell.cs new file mode 100644 index 000000000000..ddbe58d3f025 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Manager.PowerShell.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The StorSimple Manager + [System.ComponentModel.TypeConverter(typeof(ManagerTypeConverter))] + public partial class Manager + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Manager(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Manager(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Manager(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("CisIntrinsicSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).CisIntrinsicSetting = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings) content.GetValueForProperty("CisIntrinsicSetting",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).CisIntrinsicSetting, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerIntrinsicSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerSkuTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("CiIntrinsicSettingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).CiIntrinsicSettingType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType) content.GetValueForProperty("CiIntrinsicSettingType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).CiIntrinsicSettingType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).SkuName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Manager(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("CisIntrinsicSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).CisIntrinsicSetting = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings) content.GetValueForProperty("CisIntrinsicSetting",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).CisIntrinsicSetting, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerIntrinsicSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerSkuTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("CiIntrinsicSettingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).CiIntrinsicSettingType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType) content.GetValueForProperty("CiIntrinsicSettingType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).CiIntrinsicSettingType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal)this).SkuName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The StorSimple Manager + [System.ComponentModel.TypeConverter(typeof(ManagerTypeConverter))] + public partial interface IManager + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Manager.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Manager.TypeConverter.cs new file mode 100644 index 000000000000..0790a98684cc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Manager.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagerTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Manager.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Manager.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Manager.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Manager.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Manager.cs new file mode 100644 index 000000000000..ae06b2ef9ac1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Manager.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The StorSimple Manager + public partial class Manager : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Resource(); + + /// Refers to the type of the StorSimple Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType? CiIntrinsicSettingType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)Property).CiIntrinsicSettingType; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)Property).CiIntrinsicSettingType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType)""); } + + /// Backing field for property. + private string _etag; + + /// ETag of the Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Etag { get => this._etag; set => this._etag = value; } + + /// The Resource Id + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)__resource).Id; } + + /// The Geo location of the Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)__resource).Location = value ; } + + /// Internal Acessors for CisIntrinsicSetting + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal.CisIntrinsicSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)Property).CisIntrinsicSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)Property).CisIntrinsicSetting = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)Property).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)Property).Sku = value; } + + /// Internal Acessors for SkuName + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerInternal.SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)Property).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)Property).SkuName = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)__resource).Type = value; } + + /// The Resource Name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties _property; + + /// List of properties of the Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerProperties()); set => this._property = value; } + + /// + /// Specifies the state of the resource as it is getting provisioned. Value of "Succeeded" means the Manager was successfully + /// created + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)Property).ProvisioningState; } + + /// Refers to the sku name which should be "Standard" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)Property).SkuName; } + + /// Tags attached to the Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + + /// The Resource type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public Manager() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The StorSimple Manager + public partial interface IManager : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResource + { + /// Refers to the type of the StorSimple Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Refers to the type of the StorSimple Manager", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType? CiIntrinsicSettingType { get; set; } + /// ETag of the Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ETag of the Manager", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; set; } + /// + /// Specifies the state of the resource as it is getting provisioned. Value of "Succeeded" means the Manager was successfully + /// created + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Specifies the state of the resource as it is getting provisioned. Value of ""Succeeded"" means the Manager was successfully created", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Refers to the sku name which should be "Standard" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Refers to the sku name which should be ""Standard""", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string SkuName { get; } + + } + /// The StorSimple Manager + internal partial interface IManagerInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal + { + /// Refers to the type of the StorSimple Manager + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType? CiIntrinsicSettingType { get; set; } + /// Specifies if the Manager is Garda or Helsinki + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings CisIntrinsicSetting { get; set; } + /// ETag of the Manager + string Etag { get; set; } + /// List of properties of the Manager + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties Property { get; set; } + /// + /// Specifies the state of the resource as it is getting provisioned. Value of "Succeeded" means the Manager was successfully + /// created + /// + string ProvisioningState { get; set; } + /// Specifies the Sku + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku Sku { get; set; } + /// Refers to the sku name which should be "Standard" + string SkuName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Manager.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Manager.json.cs new file mode 100644 index 000000000000..4d11caec1261 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Manager.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The StorSimple Manager + public partial class Manager + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new Manager(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal Manager(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerProperties.FromJson(__jsonProperties) : Property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfo.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfo.PowerShell.cs new file mode 100644 index 000000000000..58e9fd61d5cb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfo.PowerShell.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The extended info of the manager. + [System.ComponentModel.TypeConverter(typeof(ManagerExtendedInfoTypeConverter))] + public partial class ManagerExtendedInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagerExtendedInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagerExtendedInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagerExtendedInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfoPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("IntegrityKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).IntegrityKey = (string) content.GetValueForProperty("IntegrityKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).IntegrityKey, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).EncryptionKey = (string) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).EncryptionKey, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).EncryptionKeyThumbprint = (string) content.GetValueForProperty("EncryptionKeyThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).EncryptionKeyThumbprint, global::System.Convert.ToString); + } + if (content.Contains("PortalCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).PortalCertificateThumbprint = (string) content.GetValueForProperty("PortalCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).PortalCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("Algorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Algorithm = (string) content.GetValueForProperty("Algorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Algorithm, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagerExtendedInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfoPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("IntegrityKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).IntegrityKey = (string) content.GetValueForProperty("IntegrityKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).IntegrityKey, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).EncryptionKey = (string) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).EncryptionKey, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).EncryptionKeyThumbprint = (string) content.GetValueForProperty("EncryptionKeyThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).EncryptionKeyThumbprint, global::System.Convert.ToString); + } + if (content.Contains("PortalCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).PortalCertificateThumbprint = (string) content.GetValueForProperty("PortalCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).PortalCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("Algorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Algorithm = (string) content.GetValueForProperty("Algorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal)this).Algorithm, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The extended info of the manager. + [System.ComponentModel.TypeConverter(typeof(ManagerExtendedInfoTypeConverter))] + public partial interface IManagerExtendedInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfo.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfo.TypeConverter.cs new file mode 100644 index 000000000000..a466cd5a26c7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagerExtendedInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagerExtendedInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagerExtendedInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagerExtendedInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfo.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfo.cs new file mode 100644 index 000000000000..4d2aadf65e82 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfo.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The extended info of the manager. + public partial class ManagerExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// + /// Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. + /// AlgorithmName - if encryption is used + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Algorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)Property).Algorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)Property).Algorithm = value ; } + + /// Represents the CEK of the resource + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string EncryptionKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)Property).EncryptionKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)Property).EncryptionKey = value ?? null; } + + /// Represents the Cert thumbprint that was used to encrypt the CEK + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string EncryptionKeyThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)Property).EncryptionKeyThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)Property).EncryptionKeyThumbprint = value ?? null; } + + /// Backing field for property. + private string _etag; + + /// ETag of the Resource + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Etag { get => this._etag; set => this._etag = value; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Represents the CIK of the resource + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string IntegrityKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)Property).IntegrityKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)Property).IntegrityKey = value ; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfoProperties()); set { {_property = value;} } } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// + /// Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string PortalCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)Property).PortalCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)Property).PortalCertificateThumbprint = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties _property; + + /// The extended info properties. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfoProperties()); set => this._property = value; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Represents the version of the ExtendedInfo object being persisted + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)Property).Version = value ?? null; } + + /// Creates an new instance. + public ManagerExtendedInfo() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The extended info of the manager. + public partial interface IManagerExtendedInfo : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// + /// Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. + /// AlgorithmName - if encryption is used + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. AlgorithmName - if encryption is used", + SerializedName = @"algorithm", + PossibleTypes = new [] { typeof(string) })] + string Algorithm { get; set; } + /// Represents the CEK of the resource + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the CEK of the resource", + SerializedName = @"encryptionKey", + PossibleTypes = new [] { typeof(string) })] + string EncryptionKey { get; set; } + /// Represents the Cert thumbprint that was used to encrypt the CEK + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the Cert thumbprint that was used to encrypt the CEK", + SerializedName = @"encryptionKeyThumbprint", + PossibleTypes = new [] { typeof(string) })] + string EncryptionKeyThumbprint { get; set; } + /// ETag of the Resource + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ETag of the Resource", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; set; } + /// Represents the CIK of the resource + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Represents the CIK of the resource", + SerializedName = @"integrityKey", + PossibleTypes = new [] { typeof(string) })] + string IntegrityKey { get; set; } + /// + /// Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it.", + SerializedName = @"portalCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + string PortalCertificateThumbprint { get; set; } + /// Represents the version of the ExtendedInfo object being persisted + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the version of the ExtendedInfo object being persisted", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; set; } + + } + /// The extended info of the manager. + internal partial interface IManagerExtendedInfoInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// + /// Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. + /// AlgorithmName - if encryption is used + /// + string Algorithm { get; set; } + /// Represents the CEK of the resource + string EncryptionKey { get; set; } + /// Represents the Cert thumbprint that was used to encrypt the CEK + string EncryptionKeyThumbprint { get; set; } + /// ETag of the Resource + string Etag { get; set; } + /// Represents the CIK of the resource + string IntegrityKey { get; set; } + /// + /// Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + /// + string PortalCertificateThumbprint { get; set; } + /// The extended info properties. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties Property { get; set; } + /// Represents the version of the ExtendedInfo object being persisted + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfo.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfo.json.cs new file mode 100644 index 000000000000..f861aee1a87c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfo.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The extended info of the manager. + public partial class ManagerExtendedInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ManagerExtendedInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal ManagerExtendedInfo(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfoProperties.FromJson(__jsonProperties) : Property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfoProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfoProperties.PowerShell.cs new file mode 100644 index 000000000000..132806e09975 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfoProperties.PowerShell.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Properties of the ManagerExtendedInfo + [System.ComponentModel.TypeConverter(typeof(ManagerExtendedInfoPropertiesTypeConverter))] + public partial class ManagerExtendedInfoProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagerExtendedInfoProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagerExtendedInfoProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagerExtendedInfoProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("IntegrityKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).IntegrityKey = (string) content.GetValueForProperty("IntegrityKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).IntegrityKey, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).EncryptionKey = (string) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).EncryptionKey, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).EncryptionKeyThumbprint = (string) content.GetValueForProperty("EncryptionKeyThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).EncryptionKeyThumbprint, global::System.Convert.ToString); + } + if (content.Contains("PortalCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).PortalCertificateThumbprint = (string) content.GetValueForProperty("PortalCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).PortalCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("Algorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).Algorithm = (string) content.GetValueForProperty("Algorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).Algorithm, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagerExtendedInfoProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("IntegrityKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).IntegrityKey = (string) content.GetValueForProperty("IntegrityKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).IntegrityKey, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).EncryptionKey = (string) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).EncryptionKey, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).EncryptionKeyThumbprint = (string) content.GetValueForProperty("EncryptionKeyThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).EncryptionKeyThumbprint, global::System.Convert.ToString); + } + if (content.Contains("PortalCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).PortalCertificateThumbprint = (string) content.GetValueForProperty("PortalCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).PortalCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("Algorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).Algorithm = (string) content.GetValueForProperty("Algorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal)this).Algorithm, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the ManagerExtendedInfo + [System.ComponentModel.TypeConverter(typeof(ManagerExtendedInfoPropertiesTypeConverter))] + public partial interface IManagerExtendedInfoProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfoProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfoProperties.TypeConverter.cs new file mode 100644 index 000000000000..617dc8397ceb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfoProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagerExtendedInfoPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagerExtendedInfoProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagerExtendedInfoProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagerExtendedInfoProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfoProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfoProperties.cs new file mode 100644 index 000000000000..76bd5c78f39a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfoProperties.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Properties of the ManagerExtendedInfo + public partial class ManagerExtendedInfoProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoPropertiesInternal + { + + /// Backing field for property. + private string _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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Algorithm { get => this._algorithm; set => this._algorithm = value; } + + /// Backing field for property. + private string _encryptionKey; + + /// Represents the CEK of the resource + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string EncryptionKey { get => this._encryptionKey; set => this._encryptionKey = value; } + + /// Backing field for property. + private string _encryptionKeyThumbprint; + + /// Represents the Cert thumbprint that was used to encrypt the CEK + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string EncryptionKeyThumbprint { get => this._encryptionKeyThumbprint; set => this._encryptionKeyThumbprint = value; } + + /// Backing field for property. + private string _integrityKey; + + /// Represents the CIK of the resource + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string IntegrityKey { get => this._integrityKey; set => this._integrityKey = value; } + + /// Backing field for property. + private string _portalCertificateThumbprint; + + /// + /// Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string PortalCertificateThumbprint { get => this._portalCertificateThumbprint; set => this._portalCertificateThumbprint = value; } + + /// Backing field for property. + private string _version; + + /// Represents the version of the ExtendedInfo object being persisted + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Version { get => this._version; set => this._version = value; } + + /// Creates an new instance. + public ManagerExtendedInfoProperties() + { + + } + } + /// Properties of the ManagerExtendedInfo + public partial interface IManagerExtendedInfoProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// + /// Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. + /// AlgorithmName - if encryption is used + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. AlgorithmName - if encryption is used", + SerializedName = @"algorithm", + PossibleTypes = new [] { typeof(string) })] + string Algorithm { get; set; } + /// Represents the CEK of the resource + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the CEK of the resource", + SerializedName = @"encryptionKey", + PossibleTypes = new [] { typeof(string) })] + string EncryptionKey { get; set; } + /// Represents the Cert thumbprint that was used to encrypt the CEK + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the Cert thumbprint that was used to encrypt the CEK", + SerializedName = @"encryptionKeyThumbprint", + PossibleTypes = new [] { typeof(string) })] + string EncryptionKeyThumbprint { get; set; } + /// Represents the CIK of the resource + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Represents the CIK of the resource", + SerializedName = @"integrityKey", + PossibleTypes = new [] { typeof(string) })] + string IntegrityKey { get; set; } + /// + /// Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it.", + SerializedName = @"portalCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + string PortalCertificateThumbprint { get; set; } + /// Represents the version of the ExtendedInfo object being persisted + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the version of the ExtendedInfo object being persisted", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; set; } + + } + /// Properties of the ManagerExtendedInfo + internal partial interface IManagerExtendedInfoPropertiesInternal + + { + /// + /// Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. + /// AlgorithmName - if encryption is used + /// + string Algorithm { get; set; } + /// Represents the CEK of the resource + string EncryptionKey { get; set; } + /// Represents the Cert thumbprint that was used to encrypt the CEK + string EncryptionKeyThumbprint { get; set; } + /// Represents the CIK of the resource + string IntegrityKey { get; set; } + /// + /// Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + /// + string PortalCertificateThumbprint { get; set; } + /// Represents the version of the ExtendedInfo object being persisted + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfoProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfoProperties.json.cs new file mode 100644 index 000000000000..b7f3495fc085 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerExtendedInfoProperties.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Properties of the ManagerExtendedInfo + public partial class ManagerExtendedInfoProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfoProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ManagerExtendedInfoProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal ManagerExtendedInfoProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_integrityKey = If( json?.PropertyT("integrityKey"), out var __jsonIntegrityKey) ? (string)__jsonIntegrityKey : (string)IntegrityKey;} + {_encryptionKey = If( json?.PropertyT("encryptionKey"), out var __jsonEncryptionKey) ? (string)__jsonEncryptionKey : (string)EncryptionKey;} + {_encryptionKeyThumbprint = If( json?.PropertyT("encryptionKeyThumbprint"), out var __jsonEncryptionKeyThumbprint) ? (string)__jsonEncryptionKeyThumbprint : (string)EncryptionKeyThumbprint;} + {_portalCertificateThumbprint = If( json?.PropertyT("portalCertificateThumbprint"), out var __jsonPortalCertificateThumbprint) ? (string)__jsonPortalCertificateThumbprint : (string)PortalCertificateThumbprint;} + {_algorithm = If( json?.PropertyT("algorithm"), out var __jsonAlgorithm) ? (string)__jsonAlgorithm : (string)Algorithm;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + AddIf( null != (((object)this._integrityKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._integrityKey.ToString()) : null, "integrityKey" ,container.Add ); + AddIf( null != (((object)this._encryptionKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._encryptionKey.ToString()) : null, "encryptionKey" ,container.Add ); + AddIf( null != (((object)this._encryptionKeyThumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._encryptionKeyThumbprint.ToString()) : null, "encryptionKeyThumbprint" ,container.Add ); + AddIf( null != (((object)this._portalCertificateThumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._portalCertificateThumbprint.ToString()) : null, "portalCertificateThumbprint" ,container.Add ); + AddIf( null != (((object)this._algorithm)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._algorithm.ToString()) : null, "algorithm" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerIntrinsicSettings.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerIntrinsicSettings.PowerShell.cs new file mode 100644 index 000000000000..70a9df11c40d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerIntrinsicSettings.PowerShell.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Intrinsic settings which refers to the type of the StorSimple manager + [System.ComponentModel.TypeConverter(typeof(ManagerIntrinsicSettingsTypeConverter))] + public partial class ManagerIntrinsicSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagerIntrinsicSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagerIntrinsicSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagerIntrinsicSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettingsInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettingsInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagerIntrinsicSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettingsInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettingsInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Intrinsic settings which refers to the type of the StorSimple manager + [System.ComponentModel.TypeConverter(typeof(ManagerIntrinsicSettingsTypeConverter))] + public partial interface IManagerIntrinsicSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerIntrinsicSettings.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerIntrinsicSettings.TypeConverter.cs new file mode 100644 index 000000000000..2cf80720faa7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerIntrinsicSettings.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagerIntrinsicSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagerIntrinsicSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagerIntrinsicSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagerIntrinsicSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerIntrinsicSettings.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerIntrinsicSettings.cs new file mode 100644 index 000000000000..dba7d13c3a38 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerIntrinsicSettings.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Intrinsic settings which refers to the type of the StorSimple manager + public partial class ManagerIntrinsicSettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettingsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType _type; + + /// Refers to the type of the StorSimple Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public ManagerIntrinsicSettings() + { + + } + } + /// Intrinsic settings which refers to the type of the StorSimple manager + public partial interface IManagerIntrinsicSettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Refers to the type of the StorSimple Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Refers to the type of the StorSimple Manager", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType Type { get; set; } + + } + /// Intrinsic settings which refers to the type of the StorSimple manager + internal partial interface IManagerIntrinsicSettingsInternal + + { + /// Refers to the type of the StorSimple Manager + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerIntrinsicSettings.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerIntrinsicSettings.json.cs new file mode 100644 index 000000000000..c191513eef58 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerIntrinsicSettings.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Intrinsic settings which refers to the type of the StorSimple manager + public partial class ManagerIntrinsicSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ManagerIntrinsicSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal ManagerIntrinsicSettings(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerList.PowerShell.cs new file mode 100644 index 000000000000..b3dd9ba29506 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerList.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// List of StorSimple Managers under a particular resourceGroup + [System.ComponentModel.TypeConverter(typeof(ManagerListTypeConverter))] + public partial class ManagerList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagerList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagerList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagerList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagerList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List of StorSimple Managers under a particular resourceGroup + [System.ComponentModel.TypeConverter(typeof(ManagerListTypeConverter))] + public partial interface IManagerList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerList.TypeConverter.cs new file mode 100644 index 000000000000..f0bce71c6d6c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagerListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagerList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagerList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagerList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerList.cs new file mode 100644 index 000000000000..ce5fefc742c3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// List of StorSimple Managers under a particular resourceGroup + public partial class ManagerList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager[] _value; + + /// List of Managers + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ManagerList() + { + + } + } + /// List of StorSimple Managers under a particular resourceGroup + public partial interface IManagerList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// List of Managers + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of Managers", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager[] Value { get; set; } + + } + /// List of StorSimple Managers under a particular resourceGroup + internal partial interface IManagerListInternal + + { + /// List of Managers + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerList.json.cs new file mode 100644 index 000000000000..4625cea94322 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// List of StorSimple Managers under a particular resourceGroup + public partial class ManagerList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ManagerList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal ManagerList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Manager.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatch.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatch.PowerShell.cs new file mode 100644 index 000000000000..2ac66daed383 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatch.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The StorSimple Manager patch. + [System.ComponentModel.TypeConverter(typeof(ManagerPatchTypeConverter))] + public partial class ManagerPatch + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagerPatch(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagerPatch(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagerPatch(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerPatchTagsTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagerPatch(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerPatchTagsTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The StorSimple Manager patch. + [System.ComponentModel.TypeConverter(typeof(ManagerPatchTypeConverter))] + public partial interface IManagerPatch + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatch.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatch.TypeConverter.cs new file mode 100644 index 000000000000..8a05efbcaf88 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatch.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagerPatchTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagerPatch.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagerPatch.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagerPatch.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatch.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatch.cs new file mode 100644 index 000000000000..1168d9dbc324 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatch.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The StorSimple Manager patch. + public partial class ManagerPatch : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags _tag; + + /// The tags attached to the StorSimple Manager. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerPatchTags()); set => this._tag = value; } + + /// Creates an new instance. + public ManagerPatch() + { + + } + } + /// The StorSimple Manager patch. + public partial interface IManagerPatch : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The tags attached to the StorSimple Manager. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tags attached to the StorSimple Manager.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags Tag { get; set; } + + } + /// The StorSimple Manager patch. + internal partial interface IManagerPatchInternal + + { + /// The tags attached to the StorSimple Manager. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatch.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatch.json.cs new file mode 100644 index 000000000000..7d3d10f6dec3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatch.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The StorSimple Manager patch. + public partial class ManagerPatch + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ManagerPatch(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal ManagerPatch(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerPatchTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.PowerShell.cs new file mode 100644 index 000000000000..c3c4001940f5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.PowerShell.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The tags attached to the StorSimple Manager. + [System.ComponentModel.TypeConverter(typeof(ManagerPatchTagsTypeConverter))] + public partial class ManagerPatchTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagerPatchTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagerPatchTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagerPatchTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagerPatchTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The tags attached to the StorSimple Manager. + [System.ComponentModel.TypeConverter(typeof(ManagerPatchTagsTypeConverter))] + public partial interface IManagerPatchTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.TypeConverter.cs new file mode 100644 index 000000000000..632327aa9cb5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagerPatchTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagerPatchTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagerPatchTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagerPatchTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.cs new file mode 100644 index 000000000000..e817e2c4d68f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The tags attached to the StorSimple Manager. + public partial class ManagerPatchTags : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTagsInternal + { + + /// Creates an new instance. + public ManagerPatchTags() + { + + } + } + /// The tags attached to the StorSimple Manager. + public partial interface IManagerPatchTags : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray + { + + } + /// The tags attached to the StorSimple Manager. + internal partial interface IManagerPatchTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.dictionary.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.dictionary.cs new file mode 100644 index 000000000000..deb0958bb63b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + public partial class ManagerPatchTags : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerPatchTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.json.cs new file mode 100644 index 000000000000..652dd769e662 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerPatchTags.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The tags attached to the StorSimple Manager. + public partial class ManagerPatchTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ManagerPatchTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagerPatchTags(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerProperties.PowerShell.cs new file mode 100644 index 000000000000..994a0614ca14 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerProperties.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The properties of the Manager + [System.ComponentModel.TypeConverter(typeof(ManagerPropertiesTypeConverter))] + public partial class ManagerProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagerProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagerProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagerProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CisIntrinsicSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).CisIntrinsicSetting = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings) content.GetValueForProperty("CisIntrinsicSetting",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).CisIntrinsicSetting, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerIntrinsicSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerSkuTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("CiIntrinsicSettingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).CiIntrinsicSettingType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType) content.GetValueForProperty("CiIntrinsicSettingType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).CiIntrinsicSettingType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).SkuName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagerProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CisIntrinsicSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).CisIntrinsicSetting = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings) content.GetValueForProperty("CisIntrinsicSetting",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).CisIntrinsicSetting, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerIntrinsicSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerSkuTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("CiIntrinsicSettingType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).CiIntrinsicSettingType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType) content.GetValueForProperty("CiIntrinsicSettingType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).CiIntrinsicSettingType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal)this).SkuName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the Manager + [System.ComponentModel.TypeConverter(typeof(ManagerPropertiesTypeConverter))] + public partial interface IManagerProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerProperties.TypeConverter.cs new file mode 100644 index 000000000000..e97b7b4ba9e7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagerPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagerProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagerProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagerProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerProperties.cs new file mode 100644 index 000000000000..8bc4cb5f36cd --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerProperties.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The properties of the Manager + public partial class ManagerProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal + { + + /// Refers to the type of the StorSimple Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType? CiIntrinsicSettingType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettingsInternal)CisIntrinsicSetting).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettingsInternal)CisIntrinsicSetting).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings _cisIntrinsicSetting; + + /// Specifies if the Manager is Garda or Helsinki + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings CisIntrinsicSetting { get => (this._cisIntrinsicSetting = this._cisIntrinsicSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerIntrinsicSettings()); set => this._cisIntrinsicSetting = value; } + + /// Internal Acessors for CisIntrinsicSetting + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal.CisIntrinsicSetting { get => (this._cisIntrinsicSetting = this._cisIntrinsicSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerIntrinsicSettings()); set { {_cisIntrinsicSetting = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerSku()); set { {_sku = value;} } } + + /// Internal Acessors for SkuName + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPropertiesInternal.SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSkuInternal)Sku).Name = value; } + + /// Backing field for property. + private string _provisioningState; + + /// + /// Specifies the state of the resource as it is getting provisioned. Value of "Succeeded" means the Manager was successfully + /// created + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku _sku; + + /// Specifies the Sku + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerSku()); set => this._sku = value; } + + /// Refers to the sku name which should be "Standard" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSkuInternal)Sku).Name; } + + /// Creates an new instance. + public ManagerProperties() + { + + } + } + /// The properties of the Manager + public partial interface IManagerProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Refers to the type of the StorSimple Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Refers to the type of the StorSimple Manager", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType? CiIntrinsicSettingType { get; set; } + /// + /// Specifies the state of the resource as it is getting provisioned. Value of "Succeeded" means the Manager was successfully + /// created + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Specifies the state of the resource as it is getting provisioned. Value of ""Succeeded"" means the Manager was successfully created", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Refers to the sku name which should be "Standard" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Refers to the sku name which should be ""Standard""", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string SkuName { get; } + + } + /// The properties of the Manager + internal partial interface IManagerPropertiesInternal + + { + /// Refers to the type of the StorSimple Manager + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType? CiIntrinsicSettingType { get; set; } + /// Specifies if the Manager is Garda or Helsinki + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerIntrinsicSettings CisIntrinsicSetting { get; set; } + /// + /// Specifies the state of the resource as it is getting provisioned. Value of "Succeeded" means the Manager was successfully + /// created + /// + string ProvisioningState { get; set; } + /// Specifies the Sku + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku Sku { get; set; } + /// Refers to the sku name which should be "Standard" + string SkuName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerProperties.json.cs new file mode 100644 index 000000000000..2e989d608b43 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerProperties.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The properties of the Manager + public partial class ManagerProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ManagerProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal ManagerProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_cisIntrinsicSetting = If( json?.PropertyT("cisIntrinsicSettings"), out var __jsonCisIntrinsicSettings) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerIntrinsicSettings.FromJson(__jsonCisIntrinsicSettings) : CisIntrinsicSetting;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerSku.FromJson(__jsonSku) : Sku;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._cisIntrinsicSetting ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._cisIntrinsicSetting.ToJson(null,serializationMode) : null, "cisIntrinsicSettings" ,container.Add ); + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerSku.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerSku.PowerShell.cs new file mode 100644 index 000000000000..030af62e7436 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerSku.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The Sku. + [System.ComponentModel.TypeConverter(typeof(ManagerSkuTypeConverter))] + public partial class ManagerSku + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagerSku(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagerSku(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagerSku(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSkuInternal)this).Name, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagerSku(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSkuInternal)this).Name, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Sku. + [System.ComponentModel.TypeConverter(typeof(ManagerSkuTypeConverter))] + public partial interface IManagerSku + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerSku.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerSku.TypeConverter.cs new file mode 100644 index 000000000000..c08af85cb6c7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerSku.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagerSkuTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagerSku.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagerSku.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagerSku.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerSku.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerSku.cs new file mode 100644 index 000000000000..735ab942c8f3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerSku.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Sku. + public partial class ManagerSku : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSkuInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSkuInternal.Name { get => this._name; set { {_name = value;} } } + + /// Backing field for property. + private string _name= @"Standard"; + + /// Refers to the sku name which should be "Standard" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Creates an new instance. + public ManagerSku() + { + + } + } + /// The Sku. + public partial interface IManagerSku : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Refers to the sku name which should be "Standard" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"Refers to the sku name which should be ""Standard""", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + + } + /// The Sku. + internal partial interface IManagerSkuInternal + + { + /// Refers to the sku name which should be "Standard" + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerSku.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerSku.json.cs new file mode 100644 index 000000000000..8ff8c10d4e4e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ManagerSku.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Sku. + public partial class ManagerSku + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerSku FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ManagerSku(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal ManagerSku(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Message.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Message.PowerShell.cs new file mode 100644 index 000000000000..f4353a268f77 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Message.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(MessageTypeConverter))] + public partial class Message + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Message(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Message(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Message(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Language")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessageInternal)this).Language = (string) content.GetValueForProperty("Language",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessageInternal)this).Language, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessageInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessageInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Message(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Language")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessageInternal)this).Language = (string) content.GetValueForProperty("Language",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessageInternal)this).Language, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessageInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessageInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(MessageTypeConverter))] + public partial interface IMessage + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Message.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Message.TypeConverter.cs new file mode 100644 index 000000000000..9cfb7189d5a0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Message.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MessageTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Message.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Message.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Message.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Message.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Message.cs new file mode 100644 index 000000000000..3924681a2ce7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Message.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + public partial class Message : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessageInternal + { + + /// Backing field for property. + private string _language; + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Language { get => this._language; set => this._language = value; } + + /// Backing field for property. + private string _value; + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public Message() + { + + } + } + public partial interface IMessage : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"language", + PossibleTypes = new [] { typeof(string) })] + string Language { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + internal partial interface IMessageInternal + + { + string Language { get; set; } + + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Message.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Message.json.cs new file mode 100644 index 000000000000..9aa42f1e7958 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Message.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + public partial class Message + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMessage FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new Message(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal Message(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_language = If( json?.PropertyT("language"), out var __jsonLanguage) ? (string)__jsonLanguage : (string)Language;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._language)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._language.ToString()) : null, "language" ,container.Add ); + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricAvailablity.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricAvailablity.PowerShell.cs new file mode 100644 index 000000000000..ff65637dd405 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricAvailablity.PowerShell.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time + /// grain + /// + [System.ComponentModel.TypeConverter(typeof(MetricAvailablityTypeConverter))] + public partial class MetricAvailablity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricAvailablity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricAvailablity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricAvailablity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablityInternal)this).TimeGrain = (string) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablityInternal)this).TimeGrain, global::System.Convert.ToString); + } + if (content.Contains("Retention")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablityInternal)this).Retention = (string) content.GetValueForProperty("Retention",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablityInternal)this).Retention, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricAvailablity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablityInternal)this).TimeGrain = (string) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablityInternal)this).TimeGrain, global::System.Convert.ToString); + } + if (content.Contains("Retention")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablityInternal)this).Retention = (string) content.GetValueForProperty("Retention",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablityInternal)this).Retention, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time + /// grain + [System.ComponentModel.TypeConverter(typeof(MetricAvailablityTypeConverter))] + public partial interface IMetricAvailablity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricAvailablity.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricAvailablity.TypeConverter.cs new file mode 100644 index 000000000000..3d8b845b8914 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricAvailablity.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricAvailablityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricAvailablity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricAvailablity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricAvailablity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricAvailablity.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricAvailablity.cs new file mode 100644 index 000000000000..825f8da849ef --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricAvailablity.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// + /// Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time + /// grain + /// + public partial class MetricAvailablity : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablityInternal + { + + /// Backing field for property. + private string _retention; + + /// The retention period for the metric at the specified timegrain + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Retention { get => this._retention; set => this._retention = value; } + + /// Backing field for property. + private string _timeGrain; + + /// The time grain, specifies the aggregation interval for the metric. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string TimeGrain { get => this._timeGrain; set => this._timeGrain = value; } + + /// Creates an new instance. + public MetricAvailablity() + { + + } + } + /// Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time + /// grain + public partial interface IMetricAvailablity : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The retention period for the metric at the specified timegrain + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The retention period for the metric at the specified timegrain", + SerializedName = @"retention", + PossibleTypes = new [] { typeof(string) })] + string Retention { get; set; } + /// The time grain, specifies the aggregation interval for the metric. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The time grain, specifies the aggregation interval for the metric.", + SerializedName = @"timeGrain", + PossibleTypes = new [] { typeof(string) })] + string TimeGrain { get; set; } + + } + /// Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time + /// grain + internal partial interface IMetricAvailablityInternal + + { + /// The retention period for the metric at the specified timegrain + string Retention { get; set; } + /// The time grain, specifies the aggregation interval for the metric. + string TimeGrain { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricAvailablity.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricAvailablity.json.cs new file mode 100644 index 000000000000..a9b949be0d61 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricAvailablity.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// + /// Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time + /// grain + /// + public partial class MetricAvailablity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new MetricAvailablity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal MetricAvailablity(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_timeGrain = If( json?.PropertyT("timeGrain"), out var __jsonTimeGrain) ? (string)__jsonTimeGrain : (string)TimeGrain;} + {_retention = If( json?.PropertyT("retention"), out var __jsonRetention) ? (string)__jsonRetention : (string)Retention;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._timeGrain)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._timeGrain.ToString()) : null, "timeGrain" ,container.Add ); + AddIf( null != (((object)this._retention)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._retention.ToString()) : null, "retention" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricData.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricData.PowerShell.cs new file mode 100644 index 000000000000..cbd9c5130b91 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricData.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The metric data. + [System.ComponentModel.TypeConverter(typeof(MetricDataTypeConverter))] + public partial class MetricData + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricData(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricData(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).TimeStamp = (global::System.DateTime) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).TimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Sum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Sum = (double) content.GetValueForProperty("Sum",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Sum, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Count = (int) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Average")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Average = (double) content.GetValueForProperty("Average",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Average, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Minimum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Minimum = (double) content.GetValueForProperty("Minimum",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Minimum, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Maximum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Maximum = (double) content.GetValueForProperty("Maximum",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Maximum, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).TimeStamp = (global::System.DateTime) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).TimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Sum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Sum = (double) content.GetValueForProperty("Sum",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Sum, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Count = (int) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Average")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Average = (double) content.GetValueForProperty("Average",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Average, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Minimum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Minimum = (double) content.GetValueForProperty("Minimum",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Minimum, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("Maximum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Maximum = (double) content.GetValueForProperty("Maximum",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal)this).Maximum, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The metric data. + [System.ComponentModel.TypeConverter(typeof(MetricDataTypeConverter))] + public partial interface IMetricData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricData.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricData.TypeConverter.cs new file mode 100644 index 000000000000..b4a232b57994 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricData.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricDataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricData.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricData.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricData.cs new file mode 100644 index 000000000000..df445f96da42 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricData.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The metric data. + public partial class MetricData : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDataInternal + { + + /// Backing field for property. + private double _average; + + /// The average of all sample for the given instance + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public double Average { get => this._average; set => this._average = value; } + + /// Backing field for property. + private int _count; + + /// The count of samples of the metric data available for the given instance + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private double _maximum; + + /// The maximum of all samples available + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public double Maximum { get => this._maximum; set => this._maximum = value; } + + /// Backing field for property. + private double _minimum; + + /// The minimum of all samples available + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public double Minimum { get => this._minimum; set => this._minimum = value; } + + /// Backing field for property. + private double _sum; + + /// + /// The sum of all the samples available in the given instance of time for the specific metric data + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public double Sum { get => this._sum; set => this._sum = value; } + + /// Backing field for property. + private global::System.DateTime _timeStamp; + + /// The time when the metric data is fetched + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime TimeStamp { get => this._timeStamp; set => this._timeStamp = value; } + + /// Creates an new instance. + public MetricData() + { + + } + } + /// The metric data. + public partial interface IMetricData : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The average of all sample for the given instance + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The average of all sample for the given instance", + SerializedName = @"average", + PossibleTypes = new [] { typeof(double) })] + double Average { get; set; } + /// The count of samples of the metric data available for the given instance + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The count of samples of the metric data available for the given instance", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int Count { get; set; } + /// The maximum of all samples available + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The maximum of all samples available", + SerializedName = @"maximum", + PossibleTypes = new [] { typeof(double) })] + double Maximum { get; set; } + /// The minimum of all samples available + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The minimum of all samples available", + SerializedName = @"minimum", + PossibleTypes = new [] { typeof(double) })] + double Minimum { get; set; } + /// + /// The sum of all the samples available in the given instance of time for the specific metric data + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The sum of all the samples available in the given instance of time for the specific metric data", + SerializedName = @"sum", + PossibleTypes = new [] { typeof(double) })] + double Sum { get; set; } + /// The time when the metric data is fetched + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The time when the metric data is fetched", + SerializedName = @"timeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime TimeStamp { get; set; } + + } + /// The metric data. + internal partial interface IMetricDataInternal + + { + /// The average of all sample for the given instance + double Average { get; set; } + /// The count of samples of the metric data available for the given instance + int Count { get; set; } + /// The maximum of all samples available + double Maximum { get; set; } + /// The minimum of all samples available + double Minimum { get; set; } + /// + /// The sum of all the samples available in the given instance of time for the specific metric data + /// + double Sum { get; set; } + /// The time when the metric data is fetched + global::System.DateTime TimeStamp { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricData.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricData.json.cs new file mode 100644 index 000000000000..b6eebde26b50 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricData.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The metric data. + public partial class MetricData + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new MetricData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal MetricData(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_timeStamp = If( json?.PropertyT("timeStamp"), out var __jsonTimeStamp) ? global::System.DateTime.TryParse((string)__jsonTimeStamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimeStampValue) ? __jsonTimeStampValue : TimeStamp : TimeStamp;} + {_sum = If( json?.PropertyT("sum"), out var __jsonSum) ? (double)__jsonSum : Sum;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (int)__jsonCount : Count;} + {_average = If( json?.PropertyT("average"), out var __jsonAverage) ? (double)__jsonAverage : Average;} + {_minimum = If( json?.PropertyT("minimum"), out var __jsonMinimum) ? (double)__jsonMinimum : Minimum;} + {_maximum = If( json?.PropertyT("maximum"), out var __jsonMaximum) ? (double)__jsonMaximum : Maximum;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._timeStamp.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "timeStamp" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber(this._sum), "sum" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber(this._count), "count" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber(this._average), "average" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber(this._minimum), "minimum" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber(this._maximum), "maximum" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinition.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinition.PowerShell.cs new file mode 100644 index 000000000000..ca9a245e4a1e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinition.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Monitoring metric definition represents the metadata of the metrics. + [System.ComponentModel.TypeConverter(typeof(MetricDefinitionTypeConverter))] + public partial class MetricDefinition + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricDefinition(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricDefinition(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricDefinition(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricNameTypeConverter.ConvertFrom); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Unit = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Unit, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit.CreateFrom); + } + if (content.Contains("PrimaryAggregationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).PrimaryAggregationType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType) content.GetValueForProperty("PrimaryAggregationType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).PrimaryAggregationType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("MetricAvailability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).MetricAvailability = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity[]) content.GetValueForProperty("MetricAvailability",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).MetricAvailability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricAvailablityTypeConverter.ConvertFrom)); + } + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDimensionTypeConverter.ConvertFrom)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).NameValue, global::System.Convert.ToString); + } + if (content.Contains("NameLocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).NameLocalizedValue, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricDefinition(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricNameTypeConverter.ConvertFrom); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Unit = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Unit, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit.CreateFrom); + } + if (content.Contains("PrimaryAggregationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).PrimaryAggregationType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType) content.GetValueForProperty("PrimaryAggregationType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).PrimaryAggregationType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType.CreateFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("MetricAvailability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).MetricAvailability = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity[]) content.GetValueForProperty("MetricAvailability",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).MetricAvailability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricAvailablityTypeConverter.ConvertFrom)); + } + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDimensionTypeConverter.ConvertFrom)); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).NameValue, global::System.Convert.ToString); + } + if (content.Contains("NameLocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal)this).NameLocalizedValue, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Monitoring metric definition represents the metadata of the metrics. + [System.ComponentModel.TypeConverter(typeof(MetricDefinitionTypeConverter))] + public partial interface IMetricDefinition + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinition.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinition.TypeConverter.cs new file mode 100644 index 000000000000..c3a68c05a1b5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinition.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricDefinitionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricDefinition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricDefinition.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricDefinition.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinition.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinition.cs new file mode 100644 index 000000000000..7282e2508253 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinition.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Monitoring metric definition represents the metadata of the metrics. + public partial class MetricDefinition : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension[] _dimension; + + /// The supported dimensions + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension[] Dimension { get => this._dimension; set => this._dimension = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity[] _metricAvailability; + + /// The available metric granularities + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity[] MetricAvailability { get => this._metricAvailability; set => this._metricAvailability = value; } + + /// Internal Acessors for Name + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionInternal.Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricName()); set { {_name = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName _name; + + /// The metric name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricName()); set => this._name = value; } + + /// Localized name of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string NameLocalizedValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)Name).LocalizedValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)Name).LocalizedValue = value ; } + + /// Name of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string NameValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)Name).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)Name).Value = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType _primaryAggregationType; + + /// The metric aggregation type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType PrimaryAggregationType { get => this._primaryAggregationType; set => this._primaryAggregationType = value; } + + /// Backing field for property. + private string _resourceId; + + /// The metric source id + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Backing field for property. + private string _type; + + /// The metric definition type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit _unit; + + /// The metric unit + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit Unit { get => this._unit; set => this._unit = value; } + + /// Creates an new instance. + public MetricDefinition() + { + + } + } + /// Monitoring metric definition represents the metadata of the metrics. + public partial interface IMetricDefinition : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The supported dimensions + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The supported dimensions", + SerializedName = @"dimensions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension[] Dimension { get; set; } + /// The available metric granularities + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The available metric granularities", + SerializedName = @"metricAvailabilities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity[] MetricAvailability { get; set; } + /// Localized name of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Localized name of the metric", + SerializedName = @"localizedValue", + PossibleTypes = new [] { typeof(string) })] + string NameLocalizedValue { get; set; } + /// Name of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the metric", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string NameValue { get; set; } + /// The metric aggregation type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The metric aggregation type", + SerializedName = @"primaryAggregationType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType PrimaryAggregationType { get; set; } + /// The metric source id + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The metric source id", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// The metric definition type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The metric definition type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + /// The metric unit + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The metric unit", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit Unit { get; set; } + + } + /// Monitoring metric definition represents the metadata of the metrics. + internal partial interface IMetricDefinitionInternal + + { + /// The supported dimensions + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension[] Dimension { get; set; } + /// The available metric granularities + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity[] MetricAvailability { get; set; } + /// The metric name + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName Name { get; set; } + /// Localized name of the metric + string NameLocalizedValue { get; set; } + /// Name of the metric + string NameValue { get; set; } + /// The metric aggregation type + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType PrimaryAggregationType { get; set; } + /// The metric source id + string ResourceId { get; set; } + /// The metric definition type + string Type { get; set; } + /// The metric unit + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit Unit { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinition.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinition.json.cs new file mode 100644 index 000000000000..8630aac87843 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinition.json.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Monitoring metric definition represents the metadata of the metrics. + public partial class MetricDefinition + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new MetricDefinition(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal MetricDefinition(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricName.FromJson(__jsonName) : Name;} + {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)Unit;} + {_primaryAggregationType = If( json?.PropertyT("primaryAggregationType"), out var __jsonPrimaryAggregationType) ? (string)__jsonPrimaryAggregationType : (string)PrimaryAggregationType;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_metricAvailability = If( json?.PropertyT("metricAvailabilities"), out var __jsonMetricAvailabilities) ? If( __jsonMetricAvailabilities as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricAvailablity) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricAvailablity.FromJson(__u) )) ))() : null : MetricAvailability;} + {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? If( __jsonDimensions as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDimension.FromJson(__p) )) ))() : null : Dimension;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._name ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._name.ToJson(null,serializationMode) : null, "name" ,container.Add ); + AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit" ,container.Add ); + AddIf( null != (((object)this._primaryAggregationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._primaryAggregationType.ToString()) : null, "primaryAggregationType" ,container.Add ); + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + if (null != this._metricAvailability) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._metricAvailability ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("metricAvailabilities",__w); + } + if (null != this._dimension) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __s in this._dimension ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("dimensions",__r); + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinitionList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinitionList.PowerShell.cs new file mode 100644 index 000000000000..15346d43eb20 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinitionList.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// List of metric definition + [System.ComponentModel.TypeConverter(typeof(MetricDefinitionListTypeConverter))] + public partial class MetricDefinitionList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricDefinitionList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricDefinitionList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricDefinitionList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDefinitionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricDefinitionList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDefinitionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List of metric definition + [System.ComponentModel.TypeConverter(typeof(MetricDefinitionListTypeConverter))] + public partial interface IMetricDefinitionList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinitionList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinitionList.TypeConverter.cs new file mode 100644 index 000000000000..f6b2c24d2dad --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinitionList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricDefinitionListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricDefinitionList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricDefinitionList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricDefinitionList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinitionList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinitionList.cs new file mode 100644 index 000000000000..12c9bc671561 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinitionList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// List of metric definition + public partial class MetricDefinitionList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition[] _value; + + /// The list of metric definition + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public MetricDefinitionList() + { + + } + } + /// List of metric definition + public partial interface IMetricDefinitionList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The list of metric definition + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The list of metric definition", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition[] Value { get; set; } + + } + /// List of metric definition + internal partial interface IMetricDefinitionListInternal + + { + /// The list of metric definition + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinitionList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinitionList.json.cs new file mode 100644 index 000000000000..5978aa4f686d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDefinitionList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// List of metric definition + public partial class MetricDefinitionList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new MetricDefinitionList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal MetricDefinitionList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDefinition.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDimension.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDimension.PowerShell.cs new file mode 100644 index 000000000000..a03a5ad88098 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDimension.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Metric dimension + [System.ComponentModel.TypeConverter(typeof(MetricDimensionTypeConverter))] + public partial class MetricDimension + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricDimension(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricDimension(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricDimension(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimensionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimensionInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimensionInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricDimension(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimensionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimensionInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimensionInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Metric dimension + [System.ComponentModel.TypeConverter(typeof(MetricDimensionTypeConverter))] + public partial interface IMetricDimension + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDimension.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDimension.TypeConverter.cs new file mode 100644 index 000000000000..d56d3b0df2b8 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDimension.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricDimensionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricDimension.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricDimension.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricDimension.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDimension.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDimension.cs new file mode 100644 index 000000000000..c9eb1c936af9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDimension.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Metric dimension + public partial class MetricDimension : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimensionInternal + { + + /// Backing field for property. + private string _name; + + /// Metric dimension name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _value; + + /// Metric dimension values + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public MetricDimension() + { + + } + } + /// Metric dimension + public partial interface IMetricDimension : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Metric dimension name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Metric dimension name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Metric dimension values + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Metric dimension values", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Metric dimension + internal partial interface IMetricDimensionInternal + + { + /// Metric dimension name + string Name { get; set; } + /// Metric dimension values + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDimension.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDimension.json.cs new file mode 100644 index 000000000000..91c56daf77ad --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricDimension.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Metric dimension + public partial class MetricDimension + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new MetricDimension(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal MetricDimension(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricFilter.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricFilter.PowerShell.cs new file mode 100644 index 000000000000..adaf21b04291 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricFilter.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// class representing the filters to be passed while fetching metrics + [System.ComponentModel.TypeConverter(typeof(MetricFilterTypeConverter))] + public partial class MetricFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricNameFilterTypeConverter.ConvertFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimeGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).TimeGrain = (string) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).TimeGrain, global::System.Convert.ToString); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).NameValue, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricNameFilterTypeConverter.ConvertFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimeGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).TimeGrain = (string) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).TimeGrain, global::System.Convert.ToString); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal)this).NameValue, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// class representing the filters to be passed while fetching metrics + [System.ComponentModel.TypeConverter(typeof(MetricFilterTypeConverter))] + public partial interface IMetricFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricFilter.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricFilter.TypeConverter.cs new file mode 100644 index 000000000000..e6b0735b65a3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricFilter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricFilter.cs new file mode 100644 index 000000000000..49d73d58088a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricFilter.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// class representing the filters to be passed while fetching metrics + public partial class MetricFilter : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilter, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal + { + + /// Backing field for property. + private global::System.DateTime? _endTime; + + /// endtime for fetching metrics + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? EndTime { get => this._endTime; set => this._endTime = value; } + + /// Internal Acessors for Name + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilterInternal.Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricNameFilter()); set { {_name = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter _name; + + /// filter for name property + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricNameFilter()); set => this._name = value; } + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string NameValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilterInternal)Name).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilterInternal)Name).Value = value ?? null; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// starttime for fetching metrics + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } + + /// Backing field for property. + private string _timeGrain; + + /// timegrain of the metrics + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string TimeGrain { get => this._timeGrain; set => this._timeGrain = value; } + + /// Creates an new instance. + public MetricFilter() + { + + } + } + /// class representing the filters to be passed while fetching metrics + public partial interface IMetricFilter : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// endtime for fetching metrics + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"endtime for fetching metrics", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndTime { get; set; } + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string NameValue { get; set; } + /// starttime for fetching metrics + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"starttime for fetching metrics", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + /// timegrain of the metrics + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"timegrain of the metrics", + SerializedName = @"timeGrain", + PossibleTypes = new [] { typeof(string) })] + string TimeGrain { get; set; } + + } + /// class representing the filters to be passed while fetching metrics + internal partial interface IMetricFilterInternal + + { + /// endtime for fetching metrics + global::System.DateTime? EndTime { get; set; } + /// filter for name property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter Name { get; set; } + /// The value. + string NameValue { get; set; } + /// starttime for fetching metrics + global::System.DateTime? StartTime { get; set; } + /// timegrain of the metrics + string TimeGrain { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricFilter.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricFilter.json.cs new file mode 100644 index 000000000000..b5bfe55d33d2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricFilter.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// class representing the filters to be passed while fetching metrics + public partial class MetricFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new MetricFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal MetricFilter(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricNameFilter.FromJson(__jsonName) : Name;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? global::System.DateTime.TryParse((string)__jsonEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndTimeValue) ? __jsonEndTimeValue : EndTime : EndTime;} + {_timeGrain = If( json?.PropertyT("timeGrain"), out var __jsonTimeGrain) ? (string)__jsonTimeGrain : (string)TimeGrain;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._name ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._name.ToJson(null,serializationMode) : null, "name" ,container.Add ); + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + AddIf( null != this._endTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._endTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endTime" ,container.Add ); + AddIf( null != (((object)this._timeGrain)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._timeGrain.ToString()) : null, "timeGrain" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricList.PowerShell.cs new file mode 100644 index 000000000000..e6f5b9fce212 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricList.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Collection of metrics + [System.ComponentModel.TypeConverter(typeof(MetricListTypeConverter))] + public partial class MetricList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricsTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricsTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of metrics + [System.ComponentModel.TypeConverter(typeof(MetricListTypeConverter))] + public partial interface IMetricList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricList.TypeConverter.cs new file mode 100644 index 000000000000..da2df8dfd266 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricList.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricList.cs new file mode 100644 index 000000000000..3d6e4541e16a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of metrics + public partial class MetricList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public MetricList() + { + + } + } + /// Collection of metrics + public partial interface IMetricList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics[] Value { get; set; } + + } + /// Collection of metrics + internal partial interface IMetricListInternal + + { + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricList.json.cs new file mode 100644 index 000000000000..76cafaad41ba --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of metrics + public partial class MetricList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new MetricList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal MetricList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Metrics.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricName.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricName.PowerShell.cs new file mode 100644 index 000000000000..64d0a113f385 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricName.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The name of the metric + [System.ComponentModel.TypeConverter(typeof(MetricNameTypeConverter))] + public partial class MetricName + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricName(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricName(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricName(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("LocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)this).LocalizedValue, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricName(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("LocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)this).LocalizedValue, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The name of the metric + [System.ComponentModel.TypeConverter(typeof(MetricNameTypeConverter))] + public partial interface IMetricName + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricName.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricName.TypeConverter.cs new file mode 100644 index 000000000000..42a4d1130b7b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricName.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricNameTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricName.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricName.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricName.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricName.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricName.cs new file mode 100644 index 000000000000..fd9bc7ea157d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricName.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The name of the metric + public partial class MetricName : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal + { + + /// Backing field for property. + private string _localizedValue; + + /// Localized name of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string LocalizedValue { get => this._localizedValue; set => this._localizedValue = value; } + + /// Backing field for property. + private string _value; + + /// Name of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public MetricName() + { + + } + } + /// The name of the metric + public partial interface IMetricName : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Localized name of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Localized name of the metric", + SerializedName = @"localizedValue", + PossibleTypes = new [] { typeof(string) })] + string LocalizedValue { get; set; } + /// Name of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the metric", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// The name of the metric + internal partial interface IMetricNameInternal + + { + /// Localized name of the metric + string LocalizedValue { get; set; } + /// Name of the metric + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricName.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricName.json.cs new file mode 100644 index 000000000000..227d840acefa --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricName.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The name of the metric + public partial class MetricName + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new MetricName(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal MetricName(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_localizedValue = If( json?.PropertyT("localizedValue"), out var __jsonLocalizedValue) ? (string)__jsonLocalizedValue : (string)LocalizedValue;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AddIf( null != (((object)this._localizedValue)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._localizedValue.ToString()) : null, "localizedValue" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricNameFilter.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricNameFilter.PowerShell.cs new file mode 100644 index 000000000000..920e42a27e5b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricNameFilter.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Class representing the name filter to be passed while fetching metrics + [System.ComponentModel.TypeConverter(typeof(MetricNameFilterTypeConverter))] + public partial class MetricNameFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricNameFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricNameFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricNameFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilterInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricNameFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilterInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Class representing the name filter to be passed while fetching metrics + [System.ComponentModel.TypeConverter(typeof(MetricNameFilterTypeConverter))] + public partial interface IMetricNameFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricNameFilter.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricNameFilter.TypeConverter.cs new file mode 100644 index 000000000000..fd84dcb378ca --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricNameFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricNameFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricNameFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricNameFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricNameFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricNameFilter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricNameFilter.cs new file mode 100644 index 000000000000..5526fc19b6ef --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricNameFilter.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class representing the name filter to be passed while fetching metrics + public partial class MetricNameFilter : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilterInternal + { + + /// Backing field for property. + private string _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public MetricNameFilter() + { + + } + } + /// Class representing the name filter to be passed while fetching metrics + public partial interface IMetricNameFilter : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Class representing the name filter to be passed while fetching metrics + internal partial interface IMetricNameFilterInternal + + { + /// The value. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricNameFilter.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricNameFilter.json.cs new file mode 100644 index 000000000000..393314bd4440 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/MetricNameFilter.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class representing the name filter to be passed while fetching metrics + public partial class MetricNameFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new MetricNameFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal MetricNameFilter(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Metrics.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Metrics.PowerShell.cs new file mode 100644 index 000000000000..f5577ec29bf6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Metrics.PowerShell.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Monitoring metric + [System.ComponentModel.TypeConverter(typeof(MetricsTypeConverter))] + public partial class Metrics + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Metrics(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Metrics(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Metrics(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricNameTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).StartTime = (global::System.DateTime) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).EndTime = (global::System.DateTime) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimeGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).TimeGrain = (string) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).TimeGrain, global::System.Convert.ToString); + } + if (content.Contains("PrimaryAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).PrimaryAggregation = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType) content.GetValueForProperty("PrimaryAggregation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).PrimaryAggregation, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType.CreateFrom); + } + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDimensionTypeConverter.ConvertFrom)); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Unit = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Unit, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDataTypeConverter.ConvertFrom)); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).NameValue, global::System.Convert.ToString); + } + if (content.Contains("NameLocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).NameLocalizedValue, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Metrics(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricNameTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).StartTime = (global::System.DateTime) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).EndTime = (global::System.DateTime) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TimeGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).TimeGrain = (string) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).TimeGrain, global::System.Convert.ToString); + } + if (content.Contains("PrimaryAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).PrimaryAggregation = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType) content.GetValueForProperty("PrimaryAggregation",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).PrimaryAggregation, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType.CreateFrom); + } + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDimensionTypeConverter.ConvertFrom)); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Unit = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Unit, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDataTypeConverter.ConvertFrom)); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).NameValue, global::System.Convert.ToString); + } + if (content.Contains("NameLocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal)this).NameLocalizedValue, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Monitoring metric + [System.ComponentModel.TypeConverter(typeof(MetricsTypeConverter))] + public partial interface IMetrics + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Metrics.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Metrics.TypeConverter.cs new file mode 100644 index 000000000000..f4ca60bed731 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Metrics.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Metrics.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Metrics.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Metrics.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Metrics.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Metrics.cs new file mode 100644 index 000000000000..0eecf1a6ed82 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Metrics.cs @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Monitoring metric + public partial class Metrics : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension[] _dimension; + + /// The Metric dimension which indicates the source of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension[] Dimension { get => this._dimension; set => this._dimension = value; } + + /// Backing field for property. + private global::System.DateTime _endTime; + + /// The metric end time + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime EndTime { get => this._endTime; set => this._endTime = value; } + + /// Internal Acessors for Name + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricsInternal.Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricName()); set { {_name = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName _name; + + /// The name of the metrics + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricName()); set => this._name = value; } + + /// Localized name of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string NameLocalizedValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)Name).LocalizedValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)Name).LocalizedValue = value ; } + + /// Name of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string NameValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)Name).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricNameInternal)Name).Value = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType _primaryAggregation; + + /// The metric aggregation type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType PrimaryAggregation { get => this._primaryAggregation; set => this._primaryAggregation = value; } + + /// Backing field for property. + private string _resourceId; + + /// The id of metric source + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Backing field for property. + private global::System.DateTime _startTime; + + /// The metric start time + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime StartTime { get => this._startTime; set => this._startTime = value; } + + /// Backing field for property. + private string _timeGrain; + + /// The time grain, time grain indicates frequency of the metric data + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string TimeGrain { get => this._timeGrain; set => this._timeGrain = value; } + + /// Backing field for property. + private string _type; + + /// The Type of the metric data + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit _unit; + + /// The unit of the metric data + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit Unit { get => this._unit; set => this._unit = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData[] _value; + + /// The metric data + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public Metrics() + { + + } + } + /// Monitoring metric + public partial interface IMetrics : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The Metric dimension which indicates the source of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Metric dimension which indicates the source of the metric", + SerializedName = @"dimensions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension[] Dimension { get; set; } + /// The metric end time + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The metric end time", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime EndTime { get; set; } + /// Localized name of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Localized name of the metric", + SerializedName = @"localizedValue", + PossibleTypes = new [] { typeof(string) })] + string NameLocalizedValue { get; set; } + /// Name of the metric + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the metric", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string NameValue { get; set; } + /// The metric aggregation type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The metric aggregation type", + SerializedName = @"primaryAggregation", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType PrimaryAggregation { get; set; } + /// The id of metric source + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The id of metric source", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// The metric start time + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The metric start time", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime StartTime { get; set; } + /// The time grain, time grain indicates frequency of the metric data + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The time grain, time grain indicates frequency of the metric data", + SerializedName = @"timeGrain", + PossibleTypes = new [] { typeof(string) })] + string TimeGrain { get; set; } + /// The Type of the metric data + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Type of the metric data", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + /// The unit of the metric data + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The unit of the metric data", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit Unit { get; set; } + /// The metric data + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The metric data", + SerializedName = @"values", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData[] Value { get; set; } + + } + /// Monitoring metric + internal partial interface IMetricsInternal + + { + /// The Metric dimension which indicates the source of the metric + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension[] Dimension { get; set; } + /// The metric end time + global::System.DateTime EndTime { get; set; } + /// The name of the metrics + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricName Name { get; set; } + /// Localized name of the metric + string NameLocalizedValue { get; set; } + /// Name of the metric + string NameValue { get; set; } + /// The metric aggregation type + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType PrimaryAggregation { get; set; } + /// The id of metric source + string ResourceId { get; set; } + /// The metric start time + global::System.DateTime StartTime { get; set; } + /// The time grain, time grain indicates frequency of the metric data + string TimeGrain { get; set; } + /// The Type of the metric data + string Type { get; set; } + /// The unit of the metric data + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit Unit { get; set; } + /// The metric data + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Metrics.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Metrics.json.cs new file mode 100644 index 000000000000..744597587b00 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Metrics.json.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Monitoring metric + public partial class Metrics + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new Metrics(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal Metrics(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricName.FromJson(__jsonName) : Name;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? global::System.DateTime.TryParse((string)__jsonEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndTimeValue) ? __jsonEndTimeValue : EndTime : EndTime;} + {_timeGrain = If( json?.PropertyT("timeGrain"), out var __jsonTimeGrain) ? (string)__jsonTimeGrain : (string)TimeGrain;} + {_primaryAggregation = If( json?.PropertyT("primaryAggregation"), out var __jsonPrimaryAggregation) ? (string)__jsonPrimaryAggregation : (string)PrimaryAggregation;} + {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? If( __jsonDimensions as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDimension) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDimension.FromJson(__u) )) ))() : null : Dimension;} + {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)Unit;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricData) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricData.FromJson(__p) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._name ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._name.ToJson(null,serializationMode) : null, "name" ,container.Add ); + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._startTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "startTime" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._endTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "endTime" ,container.Add ); + AddIf( null != (((object)this._timeGrain)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._timeGrain.ToString()) : null, "timeGrain" ,container.Add ); + AddIf( null != (((object)this._primaryAggregation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._primaryAggregation.ToString()) : null, "primaryAggregation" ,container.Add ); + if (null != this._dimension) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._dimension ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("dimensions",__w); + } + AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + if (null != this._value) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __s in this._value ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("values",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkAdapter.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkAdapter.PowerShell.cs new file mode 100644 index 000000000000..51196b018ca5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkAdapter.PowerShell.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Represents a networkAdapter in a particular node. + [System.ComponentModel.TypeConverter(typeof(NetworkAdapterTypeConverter))] + public partial class NetworkAdapter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkAdapter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkAdapter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NetworkAdapter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IPv4Info")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4Info = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig) content.GetValueForProperty("IPv4Info",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4Info, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IPConfigTypeConverter.ConvertFrom); + } + if (content.Contains("IPv6Info")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6Info = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig) content.GetValueForProperty("IPv6Info",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6Info, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IPConfigTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DhcpStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).DhcpStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus) content.GetValueForProperty("DhcpStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).DhcpStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus.CreateFrom); + } + if (content.Contains("LinkSpeed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).LinkSpeed = (long?) content.GetValueForProperty("LinkSpeed",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).LinkSpeed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IPv4InfoIpaddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4InfoIpaddress = (string) content.GetValueForProperty("IPv4InfoIpaddress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4InfoIpaddress, global::System.Convert.ToString); + } + if (content.Contains("IPv4InfoPrefixLength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4InfoPrefixLength = (int?) content.GetValueForProperty("IPv4InfoPrefixLength",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4InfoPrefixLength, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IPv4InfoGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4InfoGateway = (string) content.GetValueForProperty("IPv4InfoGateway",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4InfoGateway, global::System.Convert.ToString); + } + if (content.Contains("IPv6InfoIpaddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6InfoIpaddress = (string) content.GetValueForProperty("IPv6InfoIpaddress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6InfoIpaddress, global::System.Convert.ToString); + } + if (content.Contains("IPv6InfoPrefixLength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6InfoPrefixLength = (int?) content.GetValueForProperty("IPv6InfoPrefixLength",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6InfoPrefixLength, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IPv6InfoGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6InfoGateway = (string) content.GetValueForProperty("IPv6InfoGateway",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6InfoGateway, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NetworkAdapter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IPv4Info")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4Info = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig) content.GetValueForProperty("IPv4Info",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4Info, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IPConfigTypeConverter.ConvertFrom); + } + if (content.Contains("IPv6Info")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6Info = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig) content.GetValueForProperty("IPv6Info",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6Info, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IPConfigTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DhcpStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).DhcpStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus) content.GetValueForProperty("DhcpStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).DhcpStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus.CreateFrom); + } + if (content.Contains("LinkSpeed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).LinkSpeed = (long?) content.GetValueForProperty("LinkSpeed",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).LinkSpeed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IPv4InfoIpaddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4InfoIpaddress = (string) content.GetValueForProperty("IPv4InfoIpaddress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4InfoIpaddress, global::System.Convert.ToString); + } + if (content.Contains("IPv4InfoPrefixLength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4InfoPrefixLength = (int?) content.GetValueForProperty("IPv4InfoPrefixLength",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4InfoPrefixLength, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IPv4InfoGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4InfoGateway = (string) content.GetValueForProperty("IPv4InfoGateway",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv4InfoGateway, global::System.Convert.ToString); + } + if (content.Contains("IPv6InfoIpaddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6InfoIpaddress = (string) content.GetValueForProperty("IPv6InfoIpaddress",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6InfoIpaddress, global::System.Convert.ToString); + } + if (content.Contains("IPv6InfoPrefixLength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6InfoPrefixLength = (int?) content.GetValueForProperty("IPv6InfoPrefixLength",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6InfoPrefixLength, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IPv6InfoGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6InfoGateway = (string) content.GetValueForProperty("IPv6InfoGateway",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal)this).IPv6InfoGateway, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Represents a networkAdapter in a particular node. + [System.ComponentModel.TypeConverter(typeof(NetworkAdapterTypeConverter))] + public partial interface INetworkAdapter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkAdapter.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkAdapter.TypeConverter.cs new file mode 100644 index 000000000000..a27a4e1c0718 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkAdapter.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkAdapterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkAdapter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkAdapter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkAdapter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkAdapter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkAdapter.cs new file mode 100644 index 000000000000..307cd6ae8b6c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkAdapter.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Represents a networkAdapter in a particular node. + public partial class NetworkAdapter : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus _dhcpStatus; + + /// Represents state of DHCP. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus DhcpStatus { get => this._dhcpStatus; set => this._dhcpStatus = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig _iPv4Info; + + /// The ipv4 configuration of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig IPv4Info { get => (this._iPv4Info = this._iPv4Info ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IPConfig()); set => this._iPv4Info = value; } + + /// The gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string IPv4InfoGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)IPv4Info).Gateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)IPv4Info).Gateway = value ?? null; } + + /// The IP address of the network adapter, either ipv4 or ipv6. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string IPv4InfoIpaddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)IPv4Info).IPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)IPv4Info).IPAddress = value ?? null; } + + /// The prefix length of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? IPv4InfoPrefixLength { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)IPv4Info).PrefixLength; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)IPv4Info).PrefixLength = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig _iPv6Info; + + /// The ipv6 configuration of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig IPv6Info { get => (this._iPv6Info = this._iPv6Info ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IPConfig()); set => this._iPv6Info = value; } + + /// The gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string IPv6InfoGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)IPv6Info).Gateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)IPv6Info).Gateway = value ?? null; } + + /// The IP address of the network adapter, either ipv4 or ipv6. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string IPv6InfoIpaddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)IPv6Info).IPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)IPv6Info).IPAddress = value ?? null; } + + /// The prefix length of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? IPv6InfoPrefixLength { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)IPv6Info).PrefixLength; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfigInternal)IPv6Info).PrefixLength = value ?? default(int); } + + /// Backing field for property. + private long? _linkSpeed; + + /// The speed of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long? LinkSpeed { get => this._linkSpeed; set => this._linkSpeed = value; } + + /// Internal Acessors for IPv4Info + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal.IPv4Info { get => (this._iPv4Info = this._iPv4Info ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IPConfig()); set { {_iPv4Info = value;} } } + + /// Internal Acessors for IPv6Info + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapterInternal.IPv6Info { get => (this._iPv6Info = this._iPv6Info ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IPConfig()); set { {_iPv6Info = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public NetworkAdapter() + { + + } + } + /// Represents a networkAdapter in a particular node. + public partial interface INetworkAdapter : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Represents state of DHCP. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Represents state of DHCP.", + SerializedName = @"dhcpStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus DhcpStatus { get; set; } + /// The gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The gateway of the network adapter.", + SerializedName = @"gateway", + PossibleTypes = new [] { typeof(string) })] + string IPv4InfoGateway { get; set; } + /// The IP address of the network adapter, either ipv4 or ipv6. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The IP address of the network adapter, either ipv4 or ipv6.", + SerializedName = @"ipAddress", + PossibleTypes = new [] { typeof(string) })] + string IPv4InfoIpaddress { get; set; } + /// The prefix length of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The prefix length of the network adapter.", + SerializedName = @"prefixLength", + PossibleTypes = new [] { typeof(int) })] + int? IPv4InfoPrefixLength { get; set; } + /// The gateway of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The gateway of the network adapter.", + SerializedName = @"gateway", + PossibleTypes = new [] { typeof(string) })] + string IPv6InfoGateway { get; set; } + /// The IP address of the network adapter, either ipv4 or ipv6. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The IP address of the network adapter, either ipv4 or ipv6.", + SerializedName = @"ipAddress", + PossibleTypes = new [] { typeof(string) })] + string IPv6InfoIpaddress { get; set; } + /// The prefix length of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The prefix length of the network adapter.", + SerializedName = @"prefixLength", + PossibleTypes = new [] { typeof(int) })] + int? IPv6InfoPrefixLength { get; set; } + /// The speed of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The speed of the network adapter.", + SerializedName = @"linkSpeed", + PossibleTypes = new [] { typeof(long) })] + long? LinkSpeed { get; set; } + /// The name of the network adapter. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the network adapter.", + SerializedName = @"networkAdapterName", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Represents a networkAdapter in a particular node. + internal partial interface INetworkAdapterInternal + + { + /// Represents state of DHCP. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus DhcpStatus { get; set; } + /// The ipv4 configuration of the network adapter. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig IPv4Info { get; set; } + /// The gateway of the network adapter. + string IPv4InfoGateway { get; set; } + /// The IP address of the network adapter, either ipv4 or ipv6. + string IPv4InfoIpaddress { get; set; } + /// The prefix length of the network adapter. + int? IPv4InfoPrefixLength { get; set; } + /// The ipv6 configuration of the network adapter. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIPConfig IPv6Info { get; set; } + /// The gateway of the network adapter. + string IPv6InfoGateway { get; set; } + /// The IP address of the network adapter, either ipv4 or ipv6. + string IPv6InfoIpaddress { get; set; } + /// The prefix length of the network adapter. + int? IPv6InfoPrefixLength { get; set; } + /// The speed of the network adapter. + long? LinkSpeed { get; set; } + /// The name of the network adapter. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkAdapter.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkAdapter.json.cs new file mode 100644 index 000000000000..3974da9e1ccd --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkAdapter.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Represents a networkAdapter in a particular node. + public partial class NetworkAdapter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new NetworkAdapter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal NetworkAdapter(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_iPv4Info = If( json?.PropertyT("iPv4Info"), out var __jsonIPv4Info) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IPConfig.FromJson(__jsonIPv4Info) : IPv4Info;} + {_iPv6Info = If( json?.PropertyT("iPv6Info"), out var __jsonIPv6Info) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IPConfig.FromJson(__jsonIPv6Info) : IPv6Info;} + {_name = If( json?.PropertyT("networkAdapterName"), out var __jsonNetworkAdapterName) ? (string)__jsonNetworkAdapterName : (string)Name;} + {_dhcpStatus = If( json?.PropertyT("dhcpStatus"), out var __jsonDhcpStatus) ? (string)__jsonDhcpStatus : (string)DhcpStatus;} + {_linkSpeed = If( json?.PropertyT("linkSpeed"), out var __jsonLinkSpeed) ? (long?)__jsonLinkSpeed : LinkSpeed;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._iPv4Info ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._iPv4Info.ToJson(null,serializationMode) : null, "iPv4Info" ,container.Add ); + AddIf( null != this._iPv6Info ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._iPv6Info.ToJson(null,serializationMode) : null, "iPv6Info" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._name.ToString()) : null, "networkAdapterName" ,container.Add ); + AddIf( null != (((object)this._dhcpStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._dhcpStatus.ToString()) : null, "dhcpStatus" ,container.Add ); + AddIf( null != this._linkSpeed ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((long)this._linkSpeed) : null, "linkSpeed" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettings.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettings.PowerShell.cs new file mode 100644 index 000000000000..86ed8c0f590a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettings.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The NetworkSettings of a device + [System.ComponentModel.TypeConverter(typeof(NetworkSettingsTypeConverter))] + public partial class NetworkSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NetworkSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PrimaryDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).PrimaryDnsServer = (string) content.GetValueForProperty("PrimaryDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).PrimaryDnsServer, global::System.Convert.ToString); + } + if (content.Contains("SecondaryDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).SecondaryDnsServer = (string) content.GetValueForProperty("SecondaryDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).SecondaryDnsServer, global::System.Convert.ToString); + } + if (content.Contains("NodeNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).NodeNetwork = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork[]) content.GetValueForProperty("NodeNetwork",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).NodeNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NodeNetworkTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NetworkSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PrimaryDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).PrimaryDnsServer = (string) content.GetValueForProperty("PrimaryDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).PrimaryDnsServer, global::System.Convert.ToString); + } + if (content.Contains("SecondaryDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).SecondaryDnsServer = (string) content.GetValueForProperty("SecondaryDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).SecondaryDnsServer, global::System.Convert.ToString); + } + if (content.Contains("NodeNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).NodeNetwork = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork[]) content.GetValueForProperty("NodeNetwork",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal)this).NodeNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NodeNetworkTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The NetworkSettings of a device + [System.ComponentModel.TypeConverter(typeof(NetworkSettingsTypeConverter))] + public partial interface INetworkSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettings.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettings.TypeConverter.cs new file mode 100644 index 000000000000..b48ab1585985 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettings.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettings.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettings.cs new file mode 100644 index 000000000000..c99000c73853 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettings.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The NetworkSettings of a device + public partial class NetworkSettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkSettingsProperties()); set { {_property = value;} } } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// The NetworkAdapters under each node of the device. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork[] NodeNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)Property).NodeNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)Property).NodeNetwork = value ; } + + /// The Primary DNS server for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string PrimaryDnsServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)Property).PrimaryDnsServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)Property).PrimaryDnsServer = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties _property; + + /// Properties of the given NetworkSettings. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkSettingsProperties()); set => this._property = value; } + + /// The secondary DNS server for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string SecondaryDnsServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)Property).SecondaryDnsServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)Property).SecondaryDnsServer = value ?? null; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public NetworkSettings() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The NetworkSettings of a device + public partial interface INetworkSettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// The NetworkAdapters under each node of the device. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The NetworkAdapters under each node of the device.", + SerializedName = @"nodeNetworks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork[] NodeNetwork { get; set; } + /// The Primary DNS server for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Primary DNS server for the device", + SerializedName = @"primaryDnsServer", + PossibleTypes = new [] { typeof(string) })] + string PrimaryDnsServer { get; set; } + /// The secondary DNS server for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The secondary DNS server for the device", + SerializedName = @"secondaryDnsServer", + PossibleTypes = new [] { typeof(string) })] + string SecondaryDnsServer { get; set; } + + } + /// The NetworkSettings of a device + internal partial interface INetworkSettingsInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The NetworkAdapters under each node of the device. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork[] NodeNetwork { get; set; } + /// The Primary DNS server for the device + string PrimaryDnsServer { get; set; } + /// Properties of the given NetworkSettings. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties Property { get; set; } + /// The secondary DNS server for the device + string SecondaryDnsServer { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettings.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettings.json.cs new file mode 100644 index 000000000000..c269d4409718 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettings.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The NetworkSettings of a device + public partial class NetworkSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new NetworkSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal NetworkSettings(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkSettingsProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettingsProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettingsProperties.PowerShell.cs new file mode 100644 index 000000000000..6779c92605e6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettingsProperties.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The properties of NetworkSettings + [System.ComponentModel.TypeConverter(typeof(NetworkSettingsPropertiesTypeConverter))] + public partial class NetworkSettingsProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkSettingsProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkSettingsProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NetworkSettingsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrimaryDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)this).PrimaryDnsServer = (string) content.GetValueForProperty("PrimaryDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)this).PrimaryDnsServer, global::System.Convert.ToString); + } + if (content.Contains("SecondaryDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)this).SecondaryDnsServer = (string) content.GetValueForProperty("SecondaryDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)this).SecondaryDnsServer, global::System.Convert.ToString); + } + if (content.Contains("NodeNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)this).NodeNetwork = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork[]) content.GetValueForProperty("NodeNetwork",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)this).NodeNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NodeNetworkTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NetworkSettingsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrimaryDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)this).PrimaryDnsServer = (string) content.GetValueForProperty("PrimaryDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)this).PrimaryDnsServer, global::System.Convert.ToString); + } + if (content.Contains("SecondaryDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)this).SecondaryDnsServer = (string) content.GetValueForProperty("SecondaryDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)this).SecondaryDnsServer, global::System.Convert.ToString); + } + if (content.Contains("NodeNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)this).NodeNetwork = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork[]) content.GetValueForProperty("NodeNetwork",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal)this).NodeNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NodeNetworkTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of NetworkSettings + [System.ComponentModel.TypeConverter(typeof(NetworkSettingsPropertiesTypeConverter))] + public partial interface INetworkSettingsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettingsProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettingsProperties.TypeConverter.cs new file mode 100644 index 000000000000..346071183be6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettingsProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkSettingsPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkSettingsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkSettingsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkSettingsProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettingsProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettingsProperties.cs new file mode 100644 index 000000000000..b6204d65a0ae --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettingsProperties.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The properties of NetworkSettings + public partial class NetworkSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork[] _nodeNetwork; + + /// The NetworkAdapters under each node of the device. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork[] NodeNetwork { get => this._nodeNetwork; set => this._nodeNetwork = value; } + + /// Backing field for property. + private string _primaryDnsServer; + + /// The Primary DNS server for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string PrimaryDnsServer { get => this._primaryDnsServer; set => this._primaryDnsServer = value; } + + /// Backing field for property. + private string _secondaryDnsServer; + + /// The secondary DNS server for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string SecondaryDnsServer { get => this._secondaryDnsServer; set => this._secondaryDnsServer = value; } + + /// Creates an new instance. + public NetworkSettingsProperties() + { + + } + } + /// The properties of NetworkSettings + public partial interface INetworkSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The NetworkAdapters under each node of the device. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The NetworkAdapters under each node of the device.", + SerializedName = @"nodeNetworks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork[] NodeNetwork { get; set; } + /// The Primary DNS server for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Primary DNS server for the device", + SerializedName = @"primaryDnsServer", + PossibleTypes = new [] { typeof(string) })] + string PrimaryDnsServer { get; set; } + /// The secondary DNS server for the device + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The secondary DNS server for the device", + SerializedName = @"secondaryDnsServer", + PossibleTypes = new [] { typeof(string) })] + string SecondaryDnsServer { get; set; } + + } + /// The properties of NetworkSettings + internal partial interface INetworkSettingsPropertiesInternal + + { + /// The NetworkAdapters under each node of the device. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork[] NodeNetwork { get; set; } + /// The Primary DNS server for the device + string PrimaryDnsServer { get; set; } + /// The secondary DNS server for the device + string SecondaryDnsServer { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettingsProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettingsProperties.json.cs new file mode 100644 index 000000000000..53f82aea514b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NetworkSettingsProperties.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The properties of NetworkSettings + public partial class NetworkSettingsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new NetworkSettingsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal NetworkSettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_primaryDnsServer = If( json?.PropertyT("primaryDnsServer"), out var __jsonPrimaryDnsServer) ? (string)__jsonPrimaryDnsServer : (string)PrimaryDnsServer;} + {_secondaryDnsServer = If( json?.PropertyT("secondaryDnsServer"), out var __jsonSecondaryDnsServer) ? (string)__jsonSecondaryDnsServer : (string)SecondaryDnsServer;} + {_nodeNetwork = If( json?.PropertyT("nodeNetworks"), out var __jsonNodeNetworks) ? If( __jsonNodeNetworks as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NodeNetwork.FromJson(__u) )) ))() : null : NodeNetwork;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._primaryDnsServer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._primaryDnsServer.ToString()) : null, "primaryDnsServer" ,container.Add ); + AddIf( null != (((object)this._secondaryDnsServer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._secondaryDnsServer.ToString()) : null, "secondaryDnsServer" ,container.Add ); + if (null != this._nodeNetwork) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._nodeNetwork ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("nodeNetworks",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NodeNetwork.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NodeNetwork.PowerShell.cs new file mode 100644 index 000000000000..389fffb6fde9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NodeNetwork.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Represents a single node in a device. + [System.ComponentModel.TypeConverter(typeof(NodeNetworkTypeConverter))] + public partial class NodeNetwork + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NodeNetwork(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NodeNetwork(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NodeNetwork(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NetworkAdapter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetworkInternal)this).NetworkAdapter = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter[]) content.GetValueForProperty("NetworkAdapter",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetworkInternal)this).NetworkAdapter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkAdapterTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NodeNetwork(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NetworkAdapter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetworkInternal)this).NetworkAdapter = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter[]) content.GetValueForProperty("NetworkAdapter",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetworkInternal)this).NetworkAdapter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkAdapterTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Represents a single node in a device. + [System.ComponentModel.TypeConverter(typeof(NodeNetworkTypeConverter))] + public partial interface INodeNetwork + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NodeNetwork.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NodeNetwork.TypeConverter.cs new file mode 100644 index 000000000000..e18c85ab4d1b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NodeNetwork.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NodeNetworkTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NodeNetwork.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NodeNetwork.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NodeNetwork.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NodeNetwork.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NodeNetwork.cs new file mode 100644 index 000000000000..7b0f3a9937f0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NodeNetwork.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Represents a single node in a device. + public partial class NodeNetwork : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetworkInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter[] _networkAdapter; + + /// The array of network adapters in the node. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter[] NetworkAdapter { get => this._networkAdapter; set => this._networkAdapter = value; } + + /// Creates an new instance. + public NodeNetwork() + { + + } + } + /// Represents a single node in a device. + public partial interface INodeNetwork : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The array of network adapters in the node. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The array of network adapters in the node.", + SerializedName = @"networkAdapters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter[] NetworkAdapter { get; set; } + + } + /// Represents a single node in a device. + internal partial interface INodeNetworkInternal + + { + /// The array of network adapters in the node. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter[] NetworkAdapter { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NodeNetwork.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NodeNetwork.json.cs new file mode 100644 index 000000000000..f81a2bebec29 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/NodeNetwork.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Represents a single node in a device. + public partial class NodeNetwork + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INodeNetwork FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new NodeNetwork(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal NodeNetwork(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_networkAdapter = If( json?.PropertyT("networkAdapters"), out var __jsonNetworkAdapters) ? If( __jsonNetworkAdapters as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkAdapter) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkAdapter.FromJson(__u) )) ))() : null : NetworkAdapter;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._networkAdapter) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._networkAdapter ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("networkAdapters",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/RawCertificateData.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/RawCertificateData.PowerShell.cs new file mode 100644 index 000000000000..1de2f08df44a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/RawCertificateData.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Raw Certificate Data From IDM + [System.ComponentModel.TypeConverter(typeof(RawCertificateDataTypeConverter))] + public partial class RawCertificateData + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RawCertificateData(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RawCertificateData(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RawCertificateData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AuthType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateDataInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateDataInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType.CreateFrom); + } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateDataInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateDataInternal)this).Certificate, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RawCertificateData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AuthType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateDataInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateDataInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType.CreateFrom); + } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateDataInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateDataInternal)this).Certificate, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Raw Certificate Data From IDM + [System.ComponentModel.TypeConverter(typeof(RawCertificateDataTypeConverter))] + public partial interface IRawCertificateData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/RawCertificateData.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/RawCertificateData.TypeConverter.cs new file mode 100644 index 000000000000..81cbf48c1a81 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/RawCertificateData.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RawCertificateDataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RawCertificateData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RawCertificateData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RawCertificateData.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/RawCertificateData.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/RawCertificateData.cs new file mode 100644 index 000000000000..2f6fa7513a56 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/RawCertificateData.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Raw Certificate Data From IDM + public partial class RawCertificateData : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateDataInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? _authType; + + /// Specify the Authentication type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? AuthType { get => this._authType; set => this._authType = value; } + + /// Backing field for property. + private string _certificate; + + /// Gets or sets the base64 encoded certificate raw data string + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Certificate { get => this._certificate; set => this._certificate = value; } + + /// Creates an new instance. + public RawCertificateData() + { + + } + } + /// Raw Certificate Data From IDM + public partial interface IRawCertificateData : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Specify the Authentication type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify the Authentication type", + SerializedName = @"authType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? AuthType { get; set; } + /// Gets or sets the base64 encoded certificate raw data string + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Gets or sets the base64 encoded certificate raw data string", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + string Certificate { get; set; } + + } + /// Raw Certificate Data From IDM + internal partial interface IRawCertificateDataInternal + + { + /// Specify the Authentication type + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? AuthType { get; set; } + /// Gets or sets the base64 encoded certificate raw data string + string Certificate { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/RawCertificateData.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/RawCertificateData.json.cs new file mode 100644 index 000000000000..ef80ad7b3b64 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/RawCertificateData.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Raw Certificate Data From IDM + public partial class RawCertificateData + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new RawCertificateData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal RawCertificateData(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_authType = If( json?.PropertyT("authType"), out var __jsonAuthType) ? (string)__jsonAuthType : (string)AuthType;} + {_certificate = If( json?.PropertyT("certificate"), out var __jsonCertificate) ? (string)__jsonCertificate : (string)Certificate;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._authType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._authType.ToString()) : null, "authType" ,container.Add ); + AddIf( null != (((object)this._certificate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._certificate.ToString()) : null, "certificate" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Resource.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Resource.PowerShell.cs new file mode 100644 index 000000000000..25ce1abcb4ce --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Resource.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The Azure Resource. + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial class Resource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Resource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Resource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Resource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceTagsTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Resource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceTagsTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Azure Resource. + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial interface IResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Resource.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Resource.TypeConverter.cs new file mode 100644 index 000000000000..424ef252f073 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Resource.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Resource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Resource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Resource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Resource.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Resource.cs new file mode 100644 index 000000000000..44f04e6970a1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Resource.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Azure Resource. + public partial class Resource : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResource, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal + { + + /// Backing field for property. + private string _id; + + /// The Resource Id + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Backing field for property. + private string _location; + + /// The Geo location of the Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The Resource Name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags _tag; + + /// Tags attached to the Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceTags()); set => this._tag = value; } + + /// Backing field for property. + private string _type; + + /// The Resource type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public Resource() + { + + } + } + /// The Azure Resource. + public partial interface IResource : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The Resource Id + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Resource Id", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The Geo location of the Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Geo location of the Manager", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// The Resource Name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Resource Name", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Tags attached to the Manager + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags attached to the Manager", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags Tag { get; set; } + /// The Resource type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Resource type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// The Azure Resource. + internal partial interface IResourceInternal + + { + /// The Resource Id + string Id { get; set; } + /// The Geo location of the Manager + string Location { get; set; } + /// The Resource Name + string Name { get; set; } + /// Tags attached to the Manager + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags Tag { get; set; } + /// The Resource type + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Resource.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Resource.json.cs new file mode 100644 index 000000000000..8bbcc0c131df --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Resource.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Azure Resource. + public partial class Resource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new Resource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal Resource(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceCertificateAndAadDetails.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceCertificateAndAadDetails.PowerShell.cs new file mode 100644 index 000000000000..94f8747d6d9c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceCertificateAndAadDetails.PowerShell.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Resource Certificate And AAD Details from IDM + [System.ComponentModel.TypeConverter(typeof(ResourceCertificateAndAadDetailsTypeConverter))] + public partial class ResourceCertificateAndAadDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceCertificateAndAadDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceCertificateAndAadDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceCertificateAndAadDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AuthType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType.CreateFrom); + } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Certificate, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ResourceId = (long) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ResourceId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AadAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AadAuthority = (string) content.GetValueForProperty("AadAuthority",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AadAuthority, global::System.Convert.ToString); + } + if (content.Contains("AadTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AadTenantId = (string) content.GetValueForProperty("AadTenantId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AadTenantId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ServicePrincipalClientId = (string) content.GetValueForProperty("ServicePrincipalClientId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ServicePrincipalClientId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ServicePrincipalObjectId = (string) content.GetValueForProperty("ServicePrincipalObjectId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ServicePrincipalObjectId, global::System.Convert.ToString); + } + if (content.Contains("AzureManagementEndpointAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AzureManagementEndpointAudience = (string) content.GetValueForProperty("AzureManagementEndpointAudience",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AzureManagementEndpointAudience, global::System.Convert.ToString); + } + if (content.Contains("Subject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Subject = (string) content.GetValueForProperty("Subject",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Subject, global::System.Convert.ToString); + } + if (content.Contains("ValidFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ValidFrom = (global::System.DateTime) content.GetValueForProperty("ValidFrom",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ValidFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ValidTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ValidTo = (global::System.DateTime) content.GetValueForProperty("ValidTo",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ValidTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Thumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Thumbprint = (string) content.GetValueForProperty("Thumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Thumbprint, global::System.Convert.ToString); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("Issuer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Issuer = (string) content.GetValueForProperty("Issuer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Issuer, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceCertificateAndAadDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AuthType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType.CreateFrom); + } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Certificate, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ResourceId = (long) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ResourceId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AadAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AadAuthority = (string) content.GetValueForProperty("AadAuthority",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AadAuthority, global::System.Convert.ToString); + } + if (content.Contains("AadTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AadTenantId = (string) content.GetValueForProperty("AadTenantId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AadTenantId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ServicePrincipalClientId = (string) content.GetValueForProperty("ServicePrincipalClientId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ServicePrincipalClientId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ServicePrincipalObjectId = (string) content.GetValueForProperty("ServicePrincipalObjectId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ServicePrincipalObjectId, global::System.Convert.ToString); + } + if (content.Contains("AzureManagementEndpointAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AzureManagementEndpointAudience = (string) content.GetValueForProperty("AzureManagementEndpointAudience",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).AzureManagementEndpointAudience, global::System.Convert.ToString); + } + if (content.Contains("Subject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Subject = (string) content.GetValueForProperty("Subject",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Subject, global::System.Convert.ToString); + } + if (content.Contains("ValidFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ValidFrom = (global::System.DateTime) content.GetValueForProperty("ValidFrom",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ValidFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ValidTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ValidTo = (global::System.DateTime) content.GetValueForProperty("ValidTo",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).ValidTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Thumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Thumbprint = (string) content.GetValueForProperty("Thumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Thumbprint, global::System.Convert.ToString); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("Issuer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Issuer = (string) content.GetValueForProperty("Issuer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)this).Issuer, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Resource Certificate And AAD Details from IDM + [System.ComponentModel.TypeConverter(typeof(ResourceCertificateAndAadDetailsTypeConverter))] + public partial interface IResourceCertificateAndAadDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceCertificateAndAadDetails.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceCertificateAndAadDetails.TypeConverter.cs new file mode 100644 index 000000000000..8f69da11512f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceCertificateAndAadDetails.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceCertificateAndAadDetailsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceCertificateAndAadDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceCertificateAndAadDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceCertificateAndAadDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceCertificateAndAadDetails.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceCertificateAndAadDetails.cs new file mode 100644 index 000000000000..7b04ec5944a5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceCertificateAndAadDetails.cs @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Resource Certificate And AAD Details from IDM + public partial class ResourceCertificateAndAadDetails : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal + { + + /// Backing field for property. + private string _aadAuthority; + + /// AAD tenant authority + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string AadAuthority { get => this._aadAuthority; set => this._aadAuthority = value; } + + /// Backing field for property. + private string _aadTenantId; + + /// AAD tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string AadTenantId { get => this._aadTenantId; set => this._aadTenantId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? _authType; + + /// Specify the Authentication type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? AuthType { get => this._authType; set => this._authType = value; } + + /// Backing field for property. + private string _azureManagementEndpointAudience; + + /// Azure Management Endpoint Audience + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string AzureManagementEndpointAudience { get => this._azureManagementEndpointAudience; set => this._azureManagementEndpointAudience = value; } + + /// Backing field for property. + private string _certificate; + + /// Gets or sets the base64 encoded certificate raw data string + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Certificate { get => this._certificate; set => this._certificate = value; } + + /// Backing field for property. + private string _friendlyName; + + /// Certificate friendly name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string FriendlyName { get => this._friendlyName; set => this._friendlyName = value; } + + /// Backing field for property. + private string _issuer; + + /// Certificate issuer + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Issuer { get => this._issuer; set => this._issuer = value; } + + /// Backing field for property. + private long _resourceId; + + /// Gets or Sets the ResourceId + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public long ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Backing field for property. + private string _servicePrincipalClientId; + + /// AAD service principal clientId + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ServicePrincipalClientId { get => this._servicePrincipalClientId; set => this._servicePrincipalClientId = value; } + + /// Backing field for property. + private string _servicePrincipalObjectId; + + /// AAD service principal ObjectId + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ServicePrincipalObjectId { get => this._servicePrincipalObjectId; set => this._servicePrincipalObjectId = value; } + + /// Backing field for property. + private string _subject; + + /// Certificate Subject Name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Subject { get => this._subject; set => this._subject = value; } + + /// Backing field for property. + private string _thumbprint; + + /// Certificate thumbprint + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Thumbprint { get => this._thumbprint; set => this._thumbprint = value; } + + /// Backing field for property. + private global::System.DateTime _validFrom; + + /// Certificate Validity start Date time + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime ValidFrom { get => this._validFrom; set => this._validFrom = value; } + + /// Backing field for property. + private global::System.DateTime _validTo; + + /// Certificate Validity End Date time + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime ValidTo { get => this._validTo; set => this._validTo = value; } + + /// Creates an new instance. + public ResourceCertificateAndAadDetails() + { + + } + } + /// Resource Certificate And AAD Details from IDM + public partial interface IResourceCertificateAndAadDetails : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// AAD tenant authority + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"AAD tenant authority", + SerializedName = @"aadAuthority", + PossibleTypes = new [] { typeof(string) })] + string AadAuthority { get; set; } + /// AAD tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"AAD tenant Id", + SerializedName = @"aadTenantId", + PossibleTypes = new [] { typeof(string) })] + string AadTenantId { get; set; } + /// Specify the Authentication type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify the Authentication type", + SerializedName = @"authType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? AuthType { get; set; } + /// Azure Management Endpoint Audience + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Management Endpoint Audience", + SerializedName = @"azureManagementEndpointAudience", + PossibleTypes = new [] { typeof(string) })] + string AzureManagementEndpointAudience { get; set; } + /// Gets or sets the base64 encoded certificate raw data string + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Gets or sets the base64 encoded certificate raw data string", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + string Certificate { get; set; } + /// Certificate friendly name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate friendly name", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Certificate issuer + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate issuer", + SerializedName = @"issuer", + PossibleTypes = new [] { typeof(string) })] + string Issuer { get; set; } + /// Gets or Sets the ResourceId + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Gets or Sets the ResourceId", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(long) })] + long ResourceId { get; set; } + /// AAD service principal clientId + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"AAD service principal clientId", + SerializedName = @"servicePrincipalClientId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalClientId { get; set; } + /// AAD service principal ObjectId + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"AAD service principal ObjectId", + SerializedName = @"servicePrincipalObjectId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalObjectId { get; set; } + /// Certificate Subject Name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate Subject Name", + SerializedName = @"subject", + PossibleTypes = new [] { typeof(string) })] + string Subject { get; set; } + /// Certificate thumbprint + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate thumbprint", + SerializedName = @"thumbprint", + PossibleTypes = new [] { typeof(string) })] + string Thumbprint { get; set; } + /// Certificate Validity start Date time + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate Validity start Date time", + SerializedName = @"validFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime ValidFrom { get; set; } + /// Certificate Validity End Date time + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate Validity End Date time", + SerializedName = @"validTo", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime ValidTo { get; set; } + + } + /// Resource Certificate And AAD Details from IDM + internal partial interface IResourceCertificateAndAadDetailsInternal + + { + /// AAD tenant authority + string AadAuthority { get; set; } + /// AAD tenant Id + string AadTenantId { get; set; } + /// Specify the Authentication type + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? AuthType { get; set; } + /// Azure Management Endpoint Audience + string AzureManagementEndpointAudience { get; set; } + /// Gets or sets the base64 encoded certificate raw data string + string Certificate { get; set; } + /// Certificate friendly name + string FriendlyName { get; set; } + /// Certificate issuer + string Issuer { get; set; } + /// Gets or Sets the ResourceId + long ResourceId { get; set; } + /// AAD service principal clientId + string ServicePrincipalClientId { get; set; } + /// AAD service principal ObjectId + string ServicePrincipalObjectId { get; set; } + /// Certificate Subject Name + string Subject { get; set; } + /// Certificate thumbprint + string Thumbprint { get; set; } + /// Certificate Validity start Date time + global::System.DateTime ValidFrom { get; set; } + /// Certificate Validity End Date time + global::System.DateTime ValidTo { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceCertificateAndAadDetails.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceCertificateAndAadDetails.json.cs new file mode 100644 index 000000000000..8161da53aa30 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceCertificateAndAadDetails.json.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Resource Certificate And AAD Details from IDM + public partial class ResourceCertificateAndAadDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ResourceCertificateAndAadDetails(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceCertificateAndAadDetails(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_authType = If( json?.PropertyT("authType"), out var __jsonAuthType) ? (string)__jsonAuthType : (string)AuthType;} + {_certificate = If( json?.PropertyT("certificate"), out var __jsonCertificate) ? (string)__jsonCertificate : (string)Certificate;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (long)__jsonResourceId : ResourceId;} + {_aadAuthority = If( json?.PropertyT("aadAuthority"), out var __jsonAadAuthority) ? (string)__jsonAadAuthority : (string)AadAuthority;} + {_aadTenantId = If( json?.PropertyT("aadTenantId"), out var __jsonAadTenantId) ? (string)__jsonAadTenantId : (string)AadTenantId;} + {_servicePrincipalClientId = If( json?.PropertyT("servicePrincipalClientId"), out var __jsonServicePrincipalClientId) ? (string)__jsonServicePrincipalClientId : (string)ServicePrincipalClientId;} + {_servicePrincipalObjectId = If( json?.PropertyT("servicePrincipalObjectId"), out var __jsonServicePrincipalObjectId) ? (string)__jsonServicePrincipalObjectId : (string)ServicePrincipalObjectId;} + {_azureManagementEndpointAudience = If( json?.PropertyT("azureManagementEndpointAudience"), out var __jsonAzureManagementEndpointAudience) ? (string)__jsonAzureManagementEndpointAudience : (string)AzureManagementEndpointAudience;} + {_subject = If( json?.PropertyT("subject"), out var __jsonSubject) ? (string)__jsonSubject : (string)Subject;} + {_validFrom = If( json?.PropertyT("validFrom"), out var __jsonValidFrom) ? global::System.DateTime.TryParse((string)__jsonValidFrom, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonValidFromValue) ? __jsonValidFromValue : ValidFrom : ValidFrom;} + {_validTo = If( json?.PropertyT("validTo"), out var __jsonValidTo) ? global::System.DateTime.TryParse((string)__jsonValidTo, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonValidToValue) ? __jsonValidToValue : ValidTo : ValidTo;} + {_thumbprint = If( json?.PropertyT("thumbprint"), out var __jsonThumbprint) ? (string)__jsonThumbprint : (string)Thumbprint;} + {_friendlyName = If( json?.PropertyT("friendlyName"), out var __jsonFriendlyName) ? (string)__jsonFriendlyName : (string)FriendlyName;} + {_issuer = If( json?.PropertyT("issuer"), out var __jsonIssuer) ? (string)__jsonIssuer : (string)Issuer;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._authType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._authType.ToString()) : null, "authType" ,container.Add ); + AddIf( null != (((object)this._certificate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._certificate.ToString()) : null, "certificate" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber(this._resourceId), "resourceId" ,container.Add ); + AddIf( null != (((object)this._aadAuthority)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._aadAuthority.ToString()) : null, "aadAuthority" ,container.Add ); + AddIf( null != (((object)this._aadTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._aadTenantId.ToString()) : null, "aadTenantId" ,container.Add ); + AddIf( null != (((object)this._servicePrincipalClientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._servicePrincipalClientId.ToString()) : null, "servicePrincipalClientId" ,container.Add ); + AddIf( null != (((object)this._servicePrincipalObjectId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._servicePrincipalObjectId.ToString()) : null, "servicePrincipalObjectId" ,container.Add ); + AddIf( null != (((object)this._azureManagementEndpointAudience)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._azureManagementEndpointAudience.ToString()) : null, "azureManagementEndpointAudience" ,container.Add ); + AddIf( null != (((object)this._subject)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._subject.ToString()) : null, "subject" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._validFrom.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "validFrom" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._validTo.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "validTo" ,container.Add ); + AddIf( null != (((object)this._thumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._thumbprint.ToString()) : null, "thumbprint" ,container.Add ); + AddIf( null != (((object)this._friendlyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._friendlyName.ToString()) : null, "friendlyName" ,container.Add ); + AddIf( null != (((object)this._issuer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._issuer.ToString()) : null, "issuer" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.PowerShell.cs new file mode 100644 index 000000000000..43486b5d0358 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.PowerShell.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Tags attached to the Manager + [System.ComponentModel.TypeConverter(typeof(ResourceTagsTypeConverter))] + public partial class ResourceTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Tags attached to the Manager + [System.ComponentModel.TypeConverter(typeof(ResourceTagsTypeConverter))] + public partial interface IResourceTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.TypeConverter.cs new file mode 100644 index 000000000000..3a1aa746d0d4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.cs new file mode 100644 index 000000000000..fd26beb788fa --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Tags attached to the Manager + public partial class ResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTagsInternal + { + + /// Creates an new instance. + public ResourceTags() + { + + } + } + /// Tags attached to the Manager + public partial interface IResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray + { + + } + /// Tags attached to the Manager + internal partial interface IResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.dictionary.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.dictionary.cs new file mode 100644 index 000000000000..144711ad932a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + public partial class ResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.json.cs new file mode 100644 index 000000000000..7d9aa547a182 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/ResourceTags.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Tags attached to the Manager + public partial class ResourceTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new ResourceTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ResourceTags(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettings.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettings.PowerShell.cs new file mode 100644 index 000000000000..b4c309bc13d1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettings.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The SecuritySettings of a device + [System.ComponentModel.TypeConverter(typeof(SecuritySettingsTypeConverter))] + public partial class SecuritySettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SecuritySettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SecuritySettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SecuritySettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SecuritySettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DeviceAdminPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPassword = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("DeviceAdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPassword, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceAdminPasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("DeviceAdminPasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("DeviceAdminPasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPasswordValue = (string) content.GetValueForProperty("DeviceAdminPasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPasswordValue, global::System.Convert.ToString); + } + if (content.Contains("DeviceAdminPasswordEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionCertificateThumbprint = (string) content.GetValueForProperty("DeviceAdminPasswordEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SecuritySettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SecuritySettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DeviceAdminPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPassword = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("DeviceAdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPassword, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceAdminPasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("DeviceAdminPasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("DeviceAdminPasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPasswordValue = (string) content.GetValueForProperty("DeviceAdminPasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPasswordValue, global::System.Convert.ToString); + } + if (content.Contains("DeviceAdminPasswordEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionCertificateThumbprint = (string) content.GetValueForProperty("DeviceAdminPasswordEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal)this).DeviceAdminPasswordEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The SecuritySettings of a device + [System.ComponentModel.TypeConverter(typeof(SecuritySettingsTypeConverter))] + public partial interface ISecuritySettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettings.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettings.TypeConverter.cs new file mode 100644 index 000000000000..4812e86c0abf --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettings.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SecuritySettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SecuritySettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SecuritySettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SecuritySettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettings.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettings.cs new file mode 100644 index 000000000000..90cd53484394 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettings.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The SecuritySettings of a device + public partial class SecuritySettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPasswordEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPasswordEncryptionAlgorithm = value ; } + + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DeviceAdminPasswordEncryptionCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPasswordEncryptionCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPasswordEncryptionCertificateThumbprint = value ?? null; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DeviceAdminPasswordValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPasswordValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPasswordValue = value ; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for DeviceAdminPassword + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal.DeviceAdminPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)Property).DeviceAdminPassword = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SecuritySettingsProperties()); set { {_property = value;} } } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties _property; + + /// Properties of the SecuritySettings. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SecuritySettingsProperties()); set => this._property = value; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public SecuritySettings() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The SecuritySettings of a device + public partial interface ISecuritySettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + string DeviceAdminPasswordEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string DeviceAdminPasswordValue { get; set; } + + } + /// The SecuritySettings of a device + internal partial interface ISecuritySettingsInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// + /// 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 + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret DeviceAdminPassword { get; set; } + /// Algorithm used to encrypt "Value" + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + string DeviceAdminPasswordEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + string DeviceAdminPasswordValue { get; set; } + /// Properties of the SecuritySettings. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettings.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettings.json.cs new file mode 100644 index 000000000000..a14649488d5c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettings.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The SecuritySettings of a device + public partial class SecuritySettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new SecuritySettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal SecuritySettings(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SecuritySettingsProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettingsProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettingsProperties.PowerShell.cs new file mode 100644 index 000000000000..f32366d34291 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettingsProperties.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The properties of SecuritySettings + [System.ComponentModel.TypeConverter(typeof(SecuritySettingsPropertiesTypeConverter))] + public partial class SecuritySettingsProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SecuritySettingsProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SecuritySettingsProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SecuritySettingsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DeviceAdminPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPassword = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("DeviceAdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPassword, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceAdminPasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("DeviceAdminPasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("DeviceAdminPasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordValue = (string) content.GetValueForProperty("DeviceAdminPasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordValue, global::System.Convert.ToString); + } + if (content.Contains("DeviceAdminPasswordEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionCertificateThumbprint = (string) content.GetValueForProperty("DeviceAdminPasswordEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SecuritySettingsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DeviceAdminPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPassword = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("DeviceAdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPassword, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("DeviceAdminPasswordEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("DeviceAdminPasswordEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("DeviceAdminPasswordValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordValue = (string) content.GetValueForProperty("DeviceAdminPasswordValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordValue, global::System.Convert.ToString); + } + if (content.Contains("DeviceAdminPasswordEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionCertificateThumbprint = (string) content.GetValueForProperty("DeviceAdminPasswordEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal)this).DeviceAdminPasswordEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of SecuritySettings + [System.ComponentModel.TypeConverter(typeof(SecuritySettingsPropertiesTypeConverter))] + public partial interface ISecuritySettingsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettingsProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettingsProperties.TypeConverter.cs new file mode 100644 index 000000000000..76b1da4666d4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettingsProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SecuritySettingsPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SecuritySettingsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SecuritySettingsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SecuritySettingsProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettingsProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettingsProperties.cs new file mode 100644 index 000000000000..8724160c0988 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettingsProperties.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The properties of SecuritySettings + public partial class SecuritySettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret _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 + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret DeviceAdminPassword { get => (this._deviceAdminPassword = this._deviceAdminPassword ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret()); set => this._deviceAdminPassword = value; } + + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)DeviceAdminPassword).EncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)DeviceAdminPassword).EncryptionAlgorithm = value ; } + + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DeviceAdminPasswordEncryptionCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)DeviceAdminPassword).EncryptionCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)DeviceAdminPassword).EncryptionCertificateThumbprint = value ?? null; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DeviceAdminPasswordValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)DeviceAdminPassword).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)DeviceAdminPassword).Value = value ; } + + /// Internal Acessors for DeviceAdminPassword + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsPropertiesInternal.DeviceAdminPassword { get => (this._deviceAdminPassword = this._deviceAdminPassword ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret()); set { {_deviceAdminPassword = value;} } } + + /// Creates an new instance. + public SecuritySettingsProperties() + { + + } + } + /// The properties of SecuritySettings + public partial interface ISecuritySettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + string DeviceAdminPasswordEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string DeviceAdminPasswordValue { get; set; } + + } + /// The properties of SecuritySettings + internal partial interface ISecuritySettingsPropertiesInternal + + { + /// + /// 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 + /// + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret DeviceAdminPassword { get; set; } + /// Algorithm used to encrypt "Value" + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + string DeviceAdminPasswordEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + string DeviceAdminPasswordValue { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettingsProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettingsProperties.json.cs new file mode 100644 index 000000000000..91d52dda1de5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SecuritySettingsProperties.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The properties of SecuritySettings + public partial class SecuritySettingsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new SecuritySettingsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal SecuritySettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_deviceAdminPassword = If( json?.PropertyT("deviceAdminPassword"), out var __jsonDeviceAdminPassword) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret.FromJson(__jsonDeviceAdminPassword) : DeviceAdminPassword;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._deviceAdminPassword ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._deviceAdminPassword.ToJson(null,serializationMode) : null, "deviceAdminPassword" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SendTestAlertEmailRequest.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SendTestAlertEmailRequest.PowerShell.cs new file mode 100644 index 000000000000..93ffb471b5e4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SendTestAlertEmailRequest.PowerShell.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Request for sending test alert email + [System.ComponentModel.TypeConverter(typeof(SendTestAlertEmailRequestTypeConverter))] + public partial class SendTestAlertEmailRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SendTestAlertEmailRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SendTestAlertEmailRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SendTestAlertEmailRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EmailList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequestInternal)this).EmailList = (string[]) content.GetValueForProperty("EmailList",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequestInternal)this).EmailList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SendTestAlertEmailRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EmailList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequestInternal)this).EmailList = (string[]) content.GetValueForProperty("EmailList",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequestInternal)this).EmailList, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Request for sending test alert email + [System.ComponentModel.TypeConverter(typeof(SendTestAlertEmailRequestTypeConverter))] + public partial interface ISendTestAlertEmailRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SendTestAlertEmailRequest.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SendTestAlertEmailRequest.TypeConverter.cs new file mode 100644 index 000000000000..1839e8093afe --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SendTestAlertEmailRequest.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SendTestAlertEmailRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SendTestAlertEmailRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SendTestAlertEmailRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SendTestAlertEmailRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SendTestAlertEmailRequest.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SendTestAlertEmailRequest.cs new file mode 100644 index 000000000000..9268224991c0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SendTestAlertEmailRequest.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Request for sending test alert email + public partial class SendTestAlertEmailRequest : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequestInternal + { + + /// Backing field for property. + private string[] _emailList; + + /// List of emails to send the test alerts + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string[] EmailList { get => this._emailList; set => this._emailList = value; } + + /// Creates an new instance. + public SendTestAlertEmailRequest() + { + + } + } + /// Request for sending test alert email + public partial interface ISendTestAlertEmailRequest : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// List of emails to send the test alerts + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of emails to send the test alerts", + SerializedName = @"emailList", + PossibleTypes = new [] { typeof(string) })] + string[] EmailList { get; set; } + + } + /// Request for sending test alert email + internal partial interface ISendTestAlertEmailRequestInternal + + { + /// List of emails to send the test alerts + string[] EmailList { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SendTestAlertEmailRequest.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SendTestAlertEmailRequest.json.cs new file mode 100644 index 000000000000..2fc58d342972 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SendTestAlertEmailRequest.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Request for sending test alert email + public partial class SendTestAlertEmailRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new SendTestAlertEmailRequest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal SendTestAlertEmailRequest(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_emailList = If( json?.PropertyT("emailList"), out var __jsonEmailList) ? If( __jsonEmailList as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : EmailList;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._emailList) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._emailList ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("emailList",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredential.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredential.PowerShell.cs new file mode 100644 index 000000000000..20d12984c54b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredential.PowerShell.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The storage account credential + [System.ComponentModel.TypeConverter(typeof(StorageAccountCredentialTypeConverter))] + public partial class StorageAccountCredential + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountCredential(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountCredential(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountCredential(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredentialPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("CloudType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).CloudType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType) content.GetValueForProperty("CloudType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).CloudType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType.CreateFrom); + } + if (content.Contains("AccessKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKey = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("AccessKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKey, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("EndPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).EndPoint = (string) content.GetValueForProperty("EndPoint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).EndPoint, global::System.Convert.ToString); + } + if (content.Contains("Login")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).Login = (string) content.GetValueForProperty("Login",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).Login, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("EnableSsl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).EnableSsl = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus) content.GetValueForProperty("EnableSsl",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).EnableSsl, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus.CreateFrom); + } + if (content.Contains("AccessKeyEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKeyEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("AccessKeyEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKeyEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("AccessKeyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKeyValue = (string) content.GetValueForProperty("AccessKeyValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKeyValue, global::System.Convert.ToString); + } + if (content.Contains("AccessKeyEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKeyEncryptionCertificateThumbprint = (string) content.GetValueForProperty("AccessKeyEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKeyEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountCredential(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredentialPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("CloudType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).CloudType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType) content.GetValueForProperty("CloudType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).CloudType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType.CreateFrom); + } + if (content.Contains("AccessKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKey = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("AccessKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKey, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("EndPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).EndPoint = (string) content.GetValueForProperty("EndPoint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).EndPoint, global::System.Convert.ToString); + } + if (content.Contains("Login")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).Login = (string) content.GetValueForProperty("Login",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).Login, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("EnableSsl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).EnableSsl = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus) content.GetValueForProperty("EnableSsl",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).EnableSsl, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus.CreateFrom); + } + if (content.Contains("AccessKeyEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKeyEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("AccessKeyEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKeyEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("AccessKeyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKeyValue = (string) content.GetValueForProperty("AccessKeyValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKeyValue, global::System.Convert.ToString); + } + if (content.Contains("AccessKeyEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKeyEncryptionCertificateThumbprint = (string) content.GetValueForProperty("AccessKeyEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal)this).AccessKeyEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The storage account credential + [System.ComponentModel.TypeConverter(typeof(StorageAccountCredentialTypeConverter))] + public partial interface IStorageAccountCredential + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredential.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredential.TypeConverter.cs new file mode 100644 index 000000000000..81995919a9be --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredential.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountCredentialTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountCredential.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountCredential.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountCredential.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredential.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredential.cs new file mode 100644 index 000000000000..85b4d38af3a0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredential.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The storage account credential + public partial class StorageAccountCredential : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm? AccessKeyEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).AccessKeyEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).AccessKeyEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm)""); } + + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string AccessKeyEncryptionCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).AccessKeyEncryptionCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).AccessKeyEncryptionCertificateThumbprint = value ?? null; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string AccessKeyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).AccessKeyValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).AccessKeyValue = value ?? null; } + + /// The cloud service provider + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType CloudType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).CloudType; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).CloudType = value ; } + + /// SSL needs to be enabled or not + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus EnableSsl { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).EnableSsl; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).EnableSsl = value ; } + + /// The storage endpoint + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string EndPoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).EndPoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).EndPoint = value ; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// The storage account's geo location + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).Location = value ?? null; } + + /// The storage account login + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Login { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).Login; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).Login = value ; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for AccessKey + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal.AccessKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).AccessKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)Property).AccessKey = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredentialProperties()); set { {_property = value;} } } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties _property; + + /// Credential properties + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredentialProperties()); set => this._property = value; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public StorageAccountCredential() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The storage account credential + public partial interface IStorageAccountCredential : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm? AccessKeyEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + string AccessKeyEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string AccessKeyValue { get; set; } + /// The cloud service provider + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The cloud service provider", + SerializedName = @"cloudType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType CloudType { get; set; } + /// SSL needs to be enabled or not + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"SSL needs to be enabled or not", + SerializedName = @"enableSSL", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus EnableSsl { get; set; } + /// The storage endpoint + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage endpoint", + SerializedName = @"endPoint", + PossibleTypes = new [] { typeof(string) })] + string EndPoint { get; set; } + /// The storage account's geo location + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The storage account's geo location", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// The storage account login + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account login", + SerializedName = @"login", + PossibleTypes = new [] { typeof(string) })] + string Login { get; set; } + + } + /// The storage account credential + internal partial interface IStorageAccountCredentialInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The details of the storage account password + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret AccessKey { get; set; } + /// Algorithm used to encrypt "Value" + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm? AccessKeyEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + string AccessKeyEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + string AccessKeyValue { get; set; } + /// The cloud service provider + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType CloudType { get; set; } + /// SSL needs to be enabled or not + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus EnableSsl { get; set; } + /// The storage endpoint + string EndPoint { get; set; } + /// The storage account's geo location + string Location { get; set; } + /// The storage account login + string Login { get; set; } + /// Credential properties + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredential.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredential.json.cs new file mode 100644 index 000000000000..12488cad0188 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredential.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The storage account credential + public partial class StorageAccountCredential + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new StorageAccountCredential(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountCredential(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredentialProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialList.PowerShell.cs new file mode 100644 index 000000000000..c039047a5469 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialList.PowerShell.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Collection of Storage account credential entities + [System.ComponentModel.TypeConverter(typeof(StorageAccountCredentialListTypeConverter))] + public partial class StorageAccountCredentialList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountCredentialList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountCredentialList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountCredentialList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredentialTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountCredentialList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredentialTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of Storage account credential entities + [System.ComponentModel.TypeConverter(typeof(StorageAccountCredentialListTypeConverter))] + public partial interface IStorageAccountCredentialList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialList.TypeConverter.cs new file mode 100644 index 000000000000..8b72f358f30d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountCredentialListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountCredentialList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountCredentialList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountCredentialList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialList.cs new file mode 100644 index 000000000000..75a0c1d5d2c6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of Storage account credential entities + public partial class StorageAccountCredentialList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public StorageAccountCredentialList() + { + + } + } + /// Collection of Storage account credential entities + public partial interface IStorageAccountCredentialList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential[] Value { get; set; } + + } + /// Collection of Storage account credential entities + internal partial interface IStorageAccountCredentialListInternal + + { + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialList.json.cs new file mode 100644 index 000000000000..277ba4828905 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of Storage account credential entities + public partial class StorageAccountCredentialList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new StorageAccountCredentialList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountCredentialList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredential.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialProperties.PowerShell.cs new file mode 100644 index 000000000000..98b3519710fb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialProperties.PowerShell.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Storage account properties + [System.ComponentModel.TypeConverter(typeof(StorageAccountCredentialPropertiesTypeConverter))] + public partial class StorageAccountCredentialProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountCredentialProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountCredentialProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountCredentialProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AccessKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKey = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("AccessKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKey, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("CloudType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).CloudType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType) content.GetValueForProperty("CloudType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).CloudType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType.CreateFrom); + } + if (content.Contains("EndPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).EndPoint = (string) content.GetValueForProperty("EndPoint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).EndPoint, global::System.Convert.ToString); + } + if (content.Contains("Login")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).Login = (string) content.GetValueForProperty("Login",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).Login, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("EnableSsl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).EnableSsl = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus) content.GetValueForProperty("EnableSsl",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).EnableSsl, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus.CreateFrom); + } + if (content.Contains("AccessKeyEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKeyEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("AccessKeyEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKeyEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("AccessKeyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKeyValue = (string) content.GetValueForProperty("AccessKeyValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKeyValue, global::System.Convert.ToString); + } + if (content.Contains("AccessKeyEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKeyEncryptionCertificateThumbprint = (string) content.GetValueForProperty("AccessKeyEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKeyEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountCredentialProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AccessKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKey = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("AccessKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKey, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("CloudType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).CloudType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType) content.GetValueForProperty("CloudType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).CloudType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType.CreateFrom); + } + if (content.Contains("EndPoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).EndPoint = (string) content.GetValueForProperty("EndPoint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).EndPoint, global::System.Convert.ToString); + } + if (content.Contains("Login")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).Login = (string) content.GetValueForProperty("Login",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).Login, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("EnableSsl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).EnableSsl = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus) content.GetValueForProperty("EnableSsl",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).EnableSsl, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus.CreateFrom); + } + if (content.Contains("AccessKeyEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKeyEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("AccessKeyEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKeyEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("AccessKeyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKeyValue = (string) content.GetValueForProperty("AccessKeyValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKeyValue, global::System.Convert.ToString); + } + if (content.Contains("AccessKeyEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKeyEncryptionCertificateThumbprint = (string) content.GetValueForProperty("AccessKeyEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal)this).AccessKeyEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Storage account properties + [System.ComponentModel.TypeConverter(typeof(StorageAccountCredentialPropertiesTypeConverter))] + public partial interface IStorageAccountCredentialProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialProperties.TypeConverter.cs new file mode 100644 index 000000000000..d17ab6daa469 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialProperties.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountCredentialPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountCredentialProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountCredentialProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountCredentialProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialProperties.cs new file mode 100644 index 000000000000..5e9adaea3e8a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialProperties.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Storage account properties + public partial class StorageAccountCredentialProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret _accessKey; + + /// The details of the storage account password + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret AccessKey { get => (this._accessKey = this._accessKey ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret()); set => this._accessKey = value; } + + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm? AccessKeyEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)AccessKey).EncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)AccessKey).EncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm)""); } + + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string AccessKeyEncryptionCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)AccessKey).EncryptionCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)AccessKey).EncryptionCertificateThumbprint = value ?? null; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string AccessKeyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)AccessKey).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)AccessKey).Value = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType _cloudType; + + /// The cloud service provider + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType CloudType { get => this._cloudType; set => this._cloudType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus _enableSsl; + + /// SSL needs to be enabled or not + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus EnableSsl { get => this._enableSsl; set => this._enableSsl = value; } + + /// Backing field for property. + private string _endPoint; + + /// The storage endpoint + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string EndPoint { get => this._endPoint; set => this._endPoint = value; } + + /// Backing field for property. + private string _location; + + /// The storage account's geo location + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Backing field for property. + private string _login; + + /// The storage account login + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Login { get => this._login; set => this._login = value; } + + /// Internal Acessors for AccessKey + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialPropertiesInternal.AccessKey { get => (this._accessKey = this._accessKey ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret()); set { {_accessKey = value;} } } + + /// Creates an new instance. + public StorageAccountCredentialProperties() + { + + } + } + /// Storage account properties + public partial interface IStorageAccountCredentialProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm? AccessKeyEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + string AccessKeyEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string AccessKeyValue { get; set; } + /// The cloud service provider + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The cloud service provider", + SerializedName = @"cloudType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType CloudType { get; set; } + /// SSL needs to be enabled or not + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"SSL needs to be enabled or not", + SerializedName = @"enableSSL", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus EnableSsl { get; set; } + /// The storage endpoint + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage endpoint", + SerializedName = @"endPoint", + PossibleTypes = new [] { typeof(string) })] + string EndPoint { get; set; } + /// The storage account's geo location + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The storage account's geo location", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// The storage account login + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account login", + SerializedName = @"login", + PossibleTypes = new [] { typeof(string) })] + string Login { get; set; } + + } + /// Storage account properties + internal partial interface IStorageAccountCredentialPropertiesInternal + + { + /// The details of the storage account password + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret AccessKey { get; set; } + /// Algorithm used to encrypt "Value" + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm? AccessKeyEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + string AccessKeyEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + string AccessKeyValue { get; set; } + /// The cloud service provider + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType CloudType { get; set; } + /// SSL needs to be enabled or not + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus EnableSsl { get; set; } + /// The storage endpoint + string EndPoint { get; set; } + /// The storage account's geo location + string Location { get; set; } + /// The storage account login + string Login { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialProperties.json.cs new file mode 100644 index 000000000000..b272de48fa10 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageAccountCredentialProperties.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Storage account properties + public partial class StorageAccountCredentialProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new StorageAccountCredentialProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountCredentialProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_accessKey = If( json?.PropertyT("accessKey"), out var __jsonAccessKey) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret.FromJson(__jsonAccessKey) : AccessKey;} + {_cloudType = If( json?.PropertyT("cloudType"), out var __jsonCloudType) ? (string)__jsonCloudType : (string)CloudType;} + {_endPoint = If( json?.PropertyT("endPoint"), out var __jsonEndPoint) ? (string)__jsonEndPoint : (string)EndPoint;} + {_login = If( json?.PropertyT("login"), out var __jsonLogin) ? (string)__jsonLogin : (string)Login;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_enableSsl = If( json?.PropertyT("enableSSL"), out var __jsonEnableSsl) ? (string)__jsonEnableSsl : (string)EnableSsl;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._accessKey ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._accessKey.ToJson(null,serializationMode) : null, "accessKey" ,container.Add ); + AddIf( null != (((object)this._cloudType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._cloudType.ToString()) : null, "cloudType" ,container.Add ); + AddIf( null != (((object)this._endPoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._endPoint.ToString()) : null, "endPoint" ,container.Add ); + AddIf( null != (((object)this._login)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._login.ToString()) : null, "login" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != (((object)this._enableSsl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._enableSsl.ToString()) : null, "enableSSL" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomain.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomain.PowerShell.cs new file mode 100644 index 000000000000..1f046c5349a4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomain.PowerShell.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The storage domain. + [System.ComponentModel.TypeConverter(typeof(StorageDomainTypeConverter))] + public partial class StorageDomain + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageDomain(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageDomain(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageDomain(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomainPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus.CreateFrom); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountCredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).StorageAccountCredentialId = (string[]) content.GetValueForProperty("StorageAccountCredentialId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).StorageAccountCredentialId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EncryptionKeyEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKeyEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptionKeyEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKeyEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("EncryptionKeyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKeyValue = (string) content.GetValueForProperty("EncryptionKeyValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKeyValue, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKeyEncryptionCertificateThumbprint = (string) content.GetValueForProperty("EncryptionKeyEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKeyEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageDomain(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomainPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus.CreateFrom); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountCredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).StorageAccountCredentialId = (string[]) content.GetValueForProperty("StorageAccountCredentialId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).StorageAccountCredentialId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EncryptionKeyEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKeyEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptionKeyEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKeyEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("EncryptionKeyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKeyValue = (string) content.GetValueForProperty("EncryptionKeyValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKeyValue, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKeyEncryptionCertificateThumbprint = (string) content.GetValueForProperty("EncryptionKeyEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal)this).EncryptionKeyEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The storage domain. + [System.ComponentModel.TypeConverter(typeof(StorageDomainTypeConverter))] + public partial interface IStorageDomain + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomain.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomain.TypeConverter.cs new file mode 100644 index 000000000000..4fd858b6d4e7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomain.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageDomainTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageDomain.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageDomain.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageDomain.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomain.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomain.cs new file mode 100644 index 000000000000..6baa77a14b55 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomain.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The storage domain. + public partial class StorageDomain : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm? EncryptionKeyEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)Property).EncryptionKeyEncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)Property).EncryptionKeyEncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm)""); } + + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string EncryptionKeyEncryptionCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)Property).EncryptionKeyEncryptionCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)Property).EncryptionKeyEncryptionCertificateThumbprint = value ?? null; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string EncryptionKeyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)Property).EncryptionKeyValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)Property).EncryptionKeyValue = value ?? null; } + + /// The encryption status "Enabled | Disabled". + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus EncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)Property).EncryptionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)Property).EncryptionStatus = value ; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for EncryptionKey + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal.EncryptionKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)Property).EncryptionKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)Property).EncryptionKey = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomainProperties()); set { {_property = value;} } } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties _property; + + /// The properties. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomainProperties()); set => this._property = value; } + + /// The storage account credentials. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string[] StorageAccountCredentialId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)Property).StorageAccountCredentialId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)Property).StorageAccountCredentialId = value ; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public StorageDomain() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The storage domain. + public partial interface IStorageDomain : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm? EncryptionKeyEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + string EncryptionKeyEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string EncryptionKeyValue { get; set; } + /// The encryption status "Enabled | Disabled". + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The encryption status ""Enabled | Disabled"".", + SerializedName = @"encryptionStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus EncryptionStatus { get; set; } + /// The storage account credentials. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account credentials.", + SerializedName = @"storageAccountCredentialIds", + PossibleTypes = new [] { typeof(string) })] + string[] StorageAccountCredentialId { get; set; } + + } + /// The storage domain. + internal partial interface IStorageDomainInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The encryption key used to encrypt the data. This is a user secret. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret EncryptionKey { get; set; } + /// Algorithm used to encrypt "Value" + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm? EncryptionKeyEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + string EncryptionKeyEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + string EncryptionKeyValue { get; set; } + /// The encryption status "Enabled | Disabled". + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus EncryptionStatus { get; set; } + /// The properties. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties Property { get; set; } + /// The storage account credentials. + string[] StorageAccountCredentialId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomain.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomain.json.cs new file mode 100644 index 000000000000..9533936a26b9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomain.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The storage domain. + public partial class StorageDomain + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new StorageDomain(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal StorageDomain(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomainProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainList.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainList.PowerShell.cs new file mode 100644 index 000000000000..854e82008636 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainList.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Collection of storage domains + [System.ComponentModel.TypeConverter(typeof(StorageDomainListTypeConverter))] + public partial class StorageDomainList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageDomainList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageDomainList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageDomainList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomainTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageDomainList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomainTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of storage domains + [System.ComponentModel.TypeConverter(typeof(StorageDomainListTypeConverter))] + public partial interface IStorageDomainList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainList.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainList.TypeConverter.cs new file mode 100644 index 000000000000..34668ffe77da --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainList.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageDomainListTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageDomainList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageDomainList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageDomainList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainList.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainList.cs new file mode 100644 index 000000000000..ca9abdc7bc7f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of storage domains + public partial class StorageDomainList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainList, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain[] _value; + + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public StorageDomainList() + { + + } + } + /// Collection of storage domains + public partial interface IStorageDomainList : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The value. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain[] Value { get; set; } + + } + /// Collection of storage domains + internal partial interface IStorageDomainListInternal + + { + /// The value. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainList.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainList.json.cs new file mode 100644 index 000000000000..f7ef7568debe --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainList.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Collection of storage domains + public partial class StorageDomainList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainList FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new StorageDomainList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal StorageDomainList(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain) (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomain.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainProperties.PowerShell.cs new file mode 100644 index 000000000000..a84007f675b5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainProperties.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The storage domain properties. + [System.ComponentModel.TypeConverter(typeof(StorageDomainPropertiesTypeConverter))] + public partial class StorageDomainProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageDomainProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageDomainProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageDomainProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountCredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).StorageAccountCredentialId = (string[]) content.GetValueForProperty("StorageAccountCredentialId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).StorageAccountCredentialId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus.CreateFrom); + } + if (content.Contains("EncryptionKeyEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKeyEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptionKeyEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKeyEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("EncryptionKeyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKeyValue = (string) content.GetValueForProperty("EncryptionKeyValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKeyValue, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKeyEncryptionCertificateThumbprint = (string) content.GetValueForProperty("EncryptionKeyEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKeyEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageDomainProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecretTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountCredentialId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).StorageAccountCredentialId = (string[]) content.GetValueForProperty("StorageAccountCredentialId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).StorageAccountCredentialId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus.CreateFrom); + } + if (content.Contains("EncryptionKeyEncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKeyEncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptionKeyEncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKeyEncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + if (content.Contains("EncryptionKeyValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKeyValue = (string) content.GetValueForProperty("EncryptionKeyValue",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKeyValue, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyEncryptionCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKeyEncryptionCertificateThumbprint = (string) content.GetValueForProperty("EncryptionKeyEncryptionCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal)this).EncryptionKeyEncryptionCertificateThumbprint, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The storage domain properties. + [System.ComponentModel.TypeConverter(typeof(StorageDomainPropertiesTypeConverter))] + public partial interface IStorageDomainProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainProperties.TypeConverter.cs new file mode 100644 index 000000000000..4f485830019b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageDomainPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageDomainProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageDomainProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageDomainProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainProperties.cs new file mode 100644 index 000000000000..8d0e4707d73e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainProperties.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The storage domain properties. + public partial class StorageDomainProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret _encryptionKey; + + /// The encryption key used to encrypt the data. This is a user secret. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret EncryptionKey { get => (this._encryptionKey = this._encryptionKey ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret()); set => this._encryptionKey = value; } + + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm? EncryptionKeyEncryptionAlgorithm { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)EncryptionKey).EncryptionAlgorithm; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)EncryptionKey).EncryptionAlgorithm = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm)""); } + + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string EncryptionKeyEncryptionCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)EncryptionKey).EncryptionCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)EncryptionKey).EncryptionCertificateThumbprint = value ?? null; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string EncryptionKeyValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)EncryptionKey).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecretInternal)EncryptionKey).Value = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus _encryptionStatus; + + /// The encryption status "Enabled | Disabled". + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus EncryptionStatus { get => this._encryptionStatus; set => this._encryptionStatus = value; } + + /// Internal Acessors for EncryptionKey + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainPropertiesInternal.EncryptionKey { get => (this._encryptionKey = this._encryptionKey ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret()); set { {_encryptionKey = value;} } } + + /// Backing field for property. + private string[] _storageAccountCredentialId; + + /// The storage account credentials. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string[] StorageAccountCredentialId { get => this._storageAccountCredentialId; set => this._storageAccountCredentialId = value; } + + /// Creates an new instance. + public StorageDomainProperties() + { + + } + } + /// The storage domain properties. + public partial interface IStorageDomainProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm? EncryptionKeyEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + string EncryptionKeyEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string EncryptionKeyValue { get; set; } + /// The encryption status "Enabled | Disabled". + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The encryption status ""Enabled | Disabled"".", + SerializedName = @"encryptionStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus EncryptionStatus { get; set; } + /// The storage account credentials. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account credentials.", + SerializedName = @"storageAccountCredentialIds", + PossibleTypes = new [] { typeof(string) })] + string[] StorageAccountCredentialId { get; set; } + + } + /// The storage domain properties. + internal partial interface IStorageDomainPropertiesInternal + + { + /// The encryption key used to encrypt the data. This is a user secret. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAsymmetricEncryptedSecret EncryptionKey { get; set; } + /// Algorithm used to encrypt "Value" + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm? EncryptionKeyEncryptionAlgorithm { get; set; } + /// Thumbprint certificate that was used to encrypt "Value" + string EncryptionKeyEncryptionCertificateThumbprint { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + string EncryptionKeyValue { get; set; } + /// The encryption status "Enabled | Disabled". + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus EncryptionStatus { get; set; } + /// The storage account credentials. + string[] StorageAccountCredentialId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainProperties.json.cs new file mode 100644 index 000000000000..624f6cf88df1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/StorageDomainProperties.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The storage domain properties. + public partial class StorageDomainProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new StorageDomainProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal StorageDomainProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_encryptionKey = If( json?.PropertyT("encryptionKey"), out var __jsonEncryptionKey) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AsymmetricEncryptedSecret.FromJson(__jsonEncryptionKey) : EncryptionKey;} + {_storageAccountCredentialId = If( json?.PropertyT("storageAccountCredentialIds"), out var __jsonStorageAccountCredentialIds) ? If( __jsonStorageAccountCredentialIds as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : StorageAccountCredentialId;} + {_encryptionStatus = If( json?.PropertyT("encryptionStatus"), out var __jsonEncryptionStatus) ? (string)__jsonEncryptionStatus : (string)EncryptionStatus;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._encryptionKey ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._encryptionKey.ToJson(null,serializationMode) : null, "encryptionKey" ,container.Add ); + if (null != this._storageAccountCredentialId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.XNodeArray(); + foreach( var __x in this._storageAccountCredentialId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("storageAccountCredentialIds",__w); + } + AddIf( null != (((object)this._encryptionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._encryptionStatus.ToString()) : null, "encryptionStatus" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SymmetricEncryptedSecret.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SymmetricEncryptedSecret.PowerShell.cs new file mode 100644 index 000000000000..ac1cd37181bc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SymmetricEncryptedSecret.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// This class can be used as the Type for any secret entity represented as Value, ValueCertificateThumbprint, EncryptionAlgorithm. + /// In this case, "Value" is a secret and the "valueThumbprint" represents the certificate thumbprint of the value. The algorithm + /// field is mainly for future usage to potentially allow different entities encrypted using different algorithms. + /// + [System.ComponentModel.TypeConverter(typeof(SymmetricEncryptedSecretTypeConverter))] + public partial class SymmetricEncryptedSecret + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SymmetricEncryptedSecret(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SymmetricEncryptedSecret(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SymmetricEncryptedSecret(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecretInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecretInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("ValueCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecretInternal)this).ValueCertificateThumbprint = (string) content.GetValueForProperty("ValueCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecretInternal)this).ValueCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("EncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecretInternal)this).EncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecretInternal)this).EncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SymmetricEncryptedSecret(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecretInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecretInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("ValueCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecretInternal)this).ValueCertificateThumbprint = (string) content.GetValueForProperty("ValueCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecretInternal)this).ValueCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("EncryptionAlgorithm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecretInternal)this).EncryptionAlgorithm = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) content.GetValueForProperty("EncryptionAlgorithm",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecretInternal)this).EncryptionAlgorithm, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// This class can be used as the Type for any secret entity represented as Value, ValueCertificateThumbprint, EncryptionAlgorithm. + /// In this case, "Value" is a secret and the "valueThumbprint" represents the certificate thumbprint of the value. The algorithm + /// field is mainly for future usage to potentially allow different entities encrypted using different algorithms. + [System.ComponentModel.TypeConverter(typeof(SymmetricEncryptedSecretTypeConverter))] + public partial interface ISymmetricEncryptedSecret + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SymmetricEncryptedSecret.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SymmetricEncryptedSecret.TypeConverter.cs new file mode 100644 index 000000000000..6c3510781b40 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SymmetricEncryptedSecret.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SymmetricEncryptedSecretTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SymmetricEncryptedSecret.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SymmetricEncryptedSecret.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SymmetricEncryptedSecret.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SymmetricEncryptedSecret.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SymmetricEncryptedSecret.cs new file mode 100644 index 000000000000..a1f7dc1b41be --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SymmetricEncryptedSecret.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// + /// This class can be used as the Type for any secret entity represented as Value, ValueCertificateThumbprint, EncryptionAlgorithm. + /// In this case, "Value" is a secret and the "valueThumbprint" represents the certificate thumbprint of the value. The algorithm + /// field is mainly for future usage to potentially allow different entities encrypted using different algorithms. + /// + public partial class SymmetricEncryptedSecret : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecretInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm _encryptionAlgorithm; + + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm EncryptionAlgorithm { get => this._encryptionAlgorithm; set => this._encryptionAlgorithm = value; } + + /// Backing field for property. + private string _value; + + /// + /// The value of the secret itself. If the secret is in plaintext or null then EncryptionAlgorithm will be none + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Backing field for property. + private string _valueCertificateThumbprint; + + /// Thumbprint cert that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ValueCertificateThumbprint { get => this._valueCertificateThumbprint; set => this._valueCertificateThumbprint = value; } + + /// Creates an new instance. + public SymmetricEncryptedSecret() + { + + } + } + /// This class can be used as the Type for any secret entity represented as Value, ValueCertificateThumbprint, EncryptionAlgorithm. + /// In this case, "Value" is a secret and the "valueThumbprint" represents the certificate thumbprint of the value. The algorithm + /// field is mainly for future usage to potentially allow different entities encrypted using different algorithms. + public partial interface ISymmetricEncryptedSecret : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Algorithm used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm EncryptionAlgorithm { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext or null then EncryptionAlgorithm will be none + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext or null then EncryptionAlgorithm will be none", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + /// Thumbprint cert that was used to encrypt "Value" + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint cert that was used to encrypt ""Value""", + SerializedName = @"valueCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + string ValueCertificateThumbprint { get; set; } + + } + /// This class can be used as the Type for any secret entity represented as Value, ValueCertificateThumbprint, EncryptionAlgorithm. + /// In this case, "Value" is a secret and the "valueThumbprint" represents the certificate thumbprint of the value. The algorithm + /// field is mainly for future usage to potentially allow different entities encrypted using different algorithms. + internal partial interface ISymmetricEncryptedSecretInternal + + { + /// Algorithm used to encrypt "Value" + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm EncryptionAlgorithm { get; set; } + /// + /// The value of the secret itself. If the secret is in plaintext or null then EncryptionAlgorithm will be none + /// + string Value { get; set; } + /// Thumbprint cert that was used to encrypt "Value" + string ValueCertificateThumbprint { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SymmetricEncryptedSecret.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SymmetricEncryptedSecret.json.cs new file mode 100644 index 000000000000..b7e62aa1ecee --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/SymmetricEncryptedSecret.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// + /// This class can be used as the Type for any secret entity represented as Value, ValueCertificateThumbprint, EncryptionAlgorithm. + /// In this case, "Value" is a secret and the "valueThumbprint" represents the certificate thumbprint of the value. The algorithm + /// field is mainly for future usage to potentially allow different entities encrypted using different algorithms. + /// + public partial class SymmetricEncryptedSecret + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new SymmetricEncryptedSecret(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal SymmetricEncryptedSecret(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_valueCertificateThumbprint = If( json?.PropertyT("valueCertificateThumbprint"), out var __jsonValueCertificateThumbprint) ? (string)__jsonValueCertificateThumbprint : (string)ValueCertificateThumbprint;} + {_encryptionAlgorithm = If( json?.PropertyT("encryptionAlgorithm"), out var __jsonEncryptionAlgorithm) ? (string)__jsonEncryptionAlgorithm : (string)EncryptionAlgorithm;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AddIf( null != (((object)this._valueCertificateThumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._valueCertificateThumbprint.ToString()) : null, "valueCertificateThumbprint" ,container.Add ); + AddIf( null != (((object)this._encryptionAlgorithm)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._encryptionAlgorithm.ToString()) : null, "encryptionAlgorithm" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Time.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Time.PowerShell.cs new file mode 100644 index 000000000000..696c50244326 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Time.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The Time. + [System.ComponentModel.TypeConverter(typeof(TimeTypeConverter))] + public partial class Time + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Time(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Time(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Time(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Hour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeInternal)this).Hour = (int) content.GetValueForProperty("Hour",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeInternal)this).Hour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Minute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeInternal)this).Minute = (int) content.GetValueForProperty("Minute",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeInternal)this).Minute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Time(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Hour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeInternal)this).Hour = (int) content.GetValueForProperty("Hour",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeInternal)this).Hour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Minute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeInternal)this).Minute = (int) content.GetValueForProperty("Minute",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeInternal)this).Minute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Time. + [System.ComponentModel.TypeConverter(typeof(TimeTypeConverter))] + public partial interface ITime + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Time.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Time.TypeConverter.cs new file mode 100644 index 000000000000..f7398e051b22 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Time.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TimeTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Time.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Time.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Time.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Time.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Time.cs new file mode 100644 index 000000000000..02e017ea77ea --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Time.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Time. + public partial class Time : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeInternal + { + + /// Backing field for property. + private int _hour; + + /// The hour. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int Hour { get => this._hour; set => this._hour = value; } + + /// Backing field for property. + private int _minute; + + /// The minute. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int Minute { get => this._minute; set => this._minute = value; } + + /// Creates an new instance. + public Time() + { + + } + } + /// The Time. + public partial interface ITime : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The hour. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The hour.", + SerializedName = @"hour", + PossibleTypes = new [] { typeof(int) })] + int Hour { get; set; } + /// The minute. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The minute.", + SerializedName = @"minute", + PossibleTypes = new [] { typeof(int) })] + int Minute { get; set; } + + } + /// The Time. + internal partial interface ITimeInternal + + { + /// The hour. + int Hour { get; set; } + /// The minute. + int Minute { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Time.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Time.json.cs new file mode 100644 index 000000000000..48415c08e237 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Time.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The Time. + public partial class Time + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITime FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new Time(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal Time(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_hour = If( json?.PropertyT("hour"), out var __jsonHour) ? (int)__jsonHour : Hour;} + {_minute = If( json?.PropertyT("minute"), out var __jsonMinute) ? (int)__jsonMinute : Minute;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber(this._hour), "hour" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber(this._minute), "minute" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettings.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettings.PowerShell.cs new file mode 100644 index 000000000000..e4e7d6e8d116 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettings.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The TimeSettings of a device + [System.ComponentModel.TypeConverter(typeof(TimeSettingsTypeConverter))] + public partial class TimeSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TimeSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TimeSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TimeSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("TimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).TimeZone, global::System.Convert.ToString); + } + if (content.Contains("PrimaryTimeServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).PrimaryTimeServer = (string) content.GetValueForProperty("PrimaryTimeServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).PrimaryTimeServer, global::System.Convert.ToString); + } + if (content.Contains("SecondaryTimeServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).SecondaryTimeServer = (string) content.GetValueForProperty("SecondaryTimeServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).SecondaryTimeServer, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TimeSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeSettingsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("TimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).TimeZone, global::System.Convert.ToString); + } + if (content.Contains("PrimaryTimeServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).PrimaryTimeServer = (string) content.GetValueForProperty("PrimaryTimeServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).PrimaryTimeServer, global::System.Convert.ToString); + } + if (content.Contains("SecondaryTimeServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).SecondaryTimeServer = (string) content.GetValueForProperty("SecondaryTimeServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal)this).SecondaryTimeServer, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The TimeSettings of a device + [System.ComponentModel.TypeConverter(typeof(TimeSettingsTypeConverter))] + public partial interface ITimeSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettings.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettings.TypeConverter.cs new file mode 100644 index 000000000000..578645a16fd3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettings.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TimeSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TimeSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TimeSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TimeSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettings.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettings.cs new file mode 100644 index 000000000000..bfb3ede0d399 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettings.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The TimeSettings of a device + public partial class TimeSettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeSettingsProperties()); set { {_property = value;} } } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// The primary Network Time Protocol (NTP) server name, like 'time.windows.com'. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string PrimaryTimeServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)Property).PrimaryTimeServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)Property).PrimaryTimeServer = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties _property; + + /// Properties of the TimeSettings. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeSettingsProperties()); set => this._property = value; } + + /// + /// The secondary Network Time Protocol (NTP) server name, like 'time.contoso.com'. It's optional. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string SecondaryTimeServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)Property).SecondaryTimeServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)Property).SecondaryTimeServer = value ?? null; } + + /// The timezone of device, like '(UTC -06:00) Central America' + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string TimeZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)Property).TimeZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)Property).TimeZone = value ; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public TimeSettings() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The TimeSettings of a device + public partial interface ITimeSettings : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// The primary Network Time Protocol (NTP) server name, like 'time.windows.com'. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The primary Network Time Protocol (NTP) server name, like 'time.windows.com'.", + SerializedName = @"primaryTimeServer", + PossibleTypes = new [] { typeof(string) })] + string PrimaryTimeServer { get; set; } + /// + /// The secondary Network Time Protocol (NTP) server name, like 'time.contoso.com'. It's optional. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The secondary Network Time Protocol (NTP) server name, like 'time.contoso.com'. It's optional.", + SerializedName = @"secondaryTimeServer", + PossibleTypes = new [] { typeof(string) })] + string SecondaryTimeServer { get; set; } + /// The timezone of device, like '(UTC -06:00) Central America' + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The timezone of device, like '(UTC -06:00) Central America'", + SerializedName = @"timeZone", + PossibleTypes = new [] { typeof(string) })] + string TimeZone { get; set; } + + } + /// The TimeSettings of a device + internal partial interface ITimeSettingsInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The primary Network Time Protocol (NTP) server name, like 'time.windows.com'. + string PrimaryTimeServer { get; set; } + /// Properties of the TimeSettings. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties Property { get; set; } + /// + /// The secondary Network Time Protocol (NTP) server name, like 'time.contoso.com'. It's optional. + /// + string SecondaryTimeServer { get; set; } + /// The timezone of device, like '(UTC -06:00) Central America' + string TimeZone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettings.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettings.json.cs new file mode 100644 index 000000000000..df1a5a8e040f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettings.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The TimeSettings of a device + public partial class TimeSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new TimeSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal TimeSettings(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeSettingsProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettingsProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettingsProperties.PowerShell.cs new file mode 100644 index 000000000000..b852827f19de --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettingsProperties.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The properties of TimeSettings + [System.ComponentModel.TypeConverter(typeof(TimeSettingsPropertiesTypeConverter))] + public partial class TimeSettingsProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TimeSettingsProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TimeSettingsProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TimeSettingsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)this).TimeZone, global::System.Convert.ToString); + } + if (content.Contains("PrimaryTimeServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)this).PrimaryTimeServer = (string) content.GetValueForProperty("PrimaryTimeServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)this).PrimaryTimeServer, global::System.Convert.ToString); + } + if (content.Contains("SecondaryTimeServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)this).SecondaryTimeServer = (string) content.GetValueForProperty("SecondaryTimeServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)this).SecondaryTimeServer, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TimeSettingsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)this).TimeZone, global::System.Convert.ToString); + } + if (content.Contains("PrimaryTimeServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)this).PrimaryTimeServer = (string) content.GetValueForProperty("PrimaryTimeServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)this).PrimaryTimeServer, global::System.Convert.ToString); + } + if (content.Contains("SecondaryTimeServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)this).SecondaryTimeServer = (string) content.GetValueForProperty("SecondaryTimeServer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal)this).SecondaryTimeServer, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of TimeSettings + [System.ComponentModel.TypeConverter(typeof(TimeSettingsPropertiesTypeConverter))] + public partial interface ITimeSettingsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettingsProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettingsProperties.TypeConverter.cs new file mode 100644 index 000000000000..02dc78a80782 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettingsProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TimeSettingsPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TimeSettingsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TimeSettingsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TimeSettingsProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettingsProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettingsProperties.cs new file mode 100644 index 000000000000..269f1bb4b4a4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettingsProperties.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The properties of TimeSettings + public partial class TimeSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsPropertiesInternal + { + + /// Backing field for property. + private string _primaryTimeServer; + + /// The primary Network Time Protocol (NTP) server name, like 'time.windows.com'. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string PrimaryTimeServer { get => this._primaryTimeServer; set => this._primaryTimeServer = value; } + + /// Backing field for property. + private string _secondaryTimeServer; + + /// + /// The secondary Network Time Protocol (NTP) server name, like 'time.contoso.com'. It's optional. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string SecondaryTimeServer { get => this._secondaryTimeServer; set => this._secondaryTimeServer = value; } + + /// Backing field for property. + private string _timeZone; + + /// The timezone of device, like '(UTC -06:00) Central America' + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string TimeZone { get => this._timeZone; set => this._timeZone = value; } + + /// Creates an new instance. + public TimeSettingsProperties() + { + + } + } + /// The properties of TimeSettings + public partial interface ITimeSettingsProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The primary Network Time Protocol (NTP) server name, like 'time.windows.com'. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The primary Network Time Protocol (NTP) server name, like 'time.windows.com'.", + SerializedName = @"primaryTimeServer", + PossibleTypes = new [] { typeof(string) })] + string PrimaryTimeServer { get; set; } + /// + /// The secondary Network Time Protocol (NTP) server name, like 'time.contoso.com'. It's optional. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The secondary Network Time Protocol (NTP) server name, like 'time.contoso.com'. It's optional.", + SerializedName = @"secondaryTimeServer", + PossibleTypes = new [] { typeof(string) })] + string SecondaryTimeServer { get; set; } + /// The timezone of device, like '(UTC -06:00) Central America' + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The timezone of device, like '(UTC -06:00) Central America'", + SerializedName = @"timeZone", + PossibleTypes = new [] { typeof(string) })] + string TimeZone { get; set; } + + } + /// The properties of TimeSettings + internal partial interface ITimeSettingsPropertiesInternal + + { + /// The primary Network Time Protocol (NTP) server name, like 'time.windows.com'. + string PrimaryTimeServer { get; set; } + /// + /// The secondary Network Time Protocol (NTP) server name, like 'time.contoso.com'. It's optional. + /// + string SecondaryTimeServer { get; set; } + /// The timezone of device, like '(UTC -06:00) Central America' + string TimeZone { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettingsProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettingsProperties.json.cs new file mode 100644 index 000000000000..3adcbab4442f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/TimeSettingsProperties.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The properties of TimeSettings + public partial class TimeSettingsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new TimeSettingsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal TimeSettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_timeZone = If( json?.PropertyT("timeZone"), out var __jsonTimeZone) ? (string)__jsonTimeZone : (string)TimeZone;} + {_primaryTimeServer = If( json?.PropertyT("primaryTimeServer"), out var __jsonPrimaryTimeServer) ? (string)__jsonPrimaryTimeServer : (string)PrimaryTimeServer;} + {_secondaryTimeServer = If( json?.PropertyT("secondaryTimeServer"), out var __jsonSecondaryTimeServer) ? (string)__jsonSecondaryTimeServer : (string)SecondaryTimeServer;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._timeZone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._timeZone.ToString()) : null, "timeZone" ,container.Add ); + AddIf( null != (((object)this._primaryTimeServer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._primaryTimeServer.ToString()) : null, "primaryTimeServer" ,container.Add ); + AddIf( null != (((object)this._secondaryTimeServer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._secondaryTimeServer.ToString()) : null, "secondaryTimeServer" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateDownloadProgress.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateDownloadProgress.PowerShell.cs new file mode 100644 index 000000000000..8532fc261a52 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateDownloadProgress.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// details available during the download + [System.ComponentModel.TypeConverter(typeof(UpdateDownloadProgressTypeConverter))] + public partial class UpdateDownloadProgress + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UpdateDownloadProgress(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UpdateDownloadProgress(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UpdateDownloadProgress(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DownloadPhase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).DownloadPhase = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase?) content.GetValueForProperty("DownloadPhase",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).DownloadPhase, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase.CreateFrom); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).PercentComplete = (int?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).PercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalBytesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).TotalBytesToDownload = (double?) content.GetValueForProperty("TotalBytesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).TotalBytesToDownload, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("TotalBytesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).TotalBytesDownloaded = (double?) content.GetValueForProperty("TotalBytesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).TotalBytesDownloaded, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("NumberOfUpdatesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).NumberOfUpdatesToDownload = (int?) content.GetValueForProperty("NumberOfUpdatesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).NumberOfUpdatesToDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfUpdatesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).NumberOfUpdatesDownloaded = (int?) content.GetValueForProperty("NumberOfUpdatesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).NumberOfUpdatesDownloaded, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UpdateDownloadProgress(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DownloadPhase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).DownloadPhase = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase?) content.GetValueForProperty("DownloadPhase",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).DownloadPhase, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase.CreateFrom); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).PercentComplete = (int?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).PercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalBytesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).TotalBytesToDownload = (double?) content.GetValueForProperty("TotalBytesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).TotalBytesToDownload, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("TotalBytesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).TotalBytesDownloaded = (double?) content.GetValueForProperty("TotalBytesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).TotalBytesDownloaded, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("NumberOfUpdatesToDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).NumberOfUpdatesToDownload = (int?) content.GetValueForProperty("NumberOfUpdatesToDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).NumberOfUpdatesToDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfUpdatesDownloaded")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).NumberOfUpdatesDownloaded = (int?) content.GetValueForProperty("NumberOfUpdatesDownloaded",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal)this).NumberOfUpdatesDownloaded, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + } + /// details available during the download + [System.ComponentModel.TypeConverter(typeof(UpdateDownloadProgressTypeConverter))] + public partial interface IUpdateDownloadProgress + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateDownloadProgress.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateDownloadProgress.TypeConverter.cs new file mode 100644 index 000000000000..3010fc2843ed --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateDownloadProgress.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UpdateDownloadProgressTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UpdateDownloadProgress.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UpdateDownloadProgress.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UpdateDownloadProgress.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateDownloadProgress.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateDownloadProgress.cs new file mode 100644 index 000000000000..e339e09effb9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateDownloadProgress.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// details available during the download + public partial class UpdateDownloadProgress : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgressInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase? _downloadPhase; + + /// The download phase. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase? DownloadPhase { get => this._downloadPhase; set => this._downloadPhase = value; } + + /// Backing field for property. + private int? _numberOfUpdatesDownloaded; + + /// Number of updates downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? NumberOfUpdatesDownloaded { get => this._numberOfUpdatesDownloaded; set => this._numberOfUpdatesDownloaded = value; } + + /// Backing field for property. + private int? _numberOfUpdatesToDownload; + + /// Number of updates to download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? NumberOfUpdatesToDownload { get => this._numberOfUpdatesToDownload; set => this._numberOfUpdatesToDownload = value; } + + /// Backing field for property. + private int? _percentComplete; + + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? PercentComplete { get => this._percentComplete; set => this._percentComplete = value; } + + /// Backing field for property. + private double? _totalBytesDownloaded; + + /// Total bytes downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public double? TotalBytesDownloaded { get => this._totalBytesDownloaded; set => this._totalBytesDownloaded = value; } + + /// Backing field for property. + private double? _totalBytesToDownload; + + /// Total bytes to download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public double? TotalBytesToDownload { get => this._totalBytesToDownload; set => this._totalBytesToDownload = value; } + + /// Creates an new instance. + public UpdateDownloadProgress() + { + + } + } + /// details available during the download + public partial interface IUpdateDownloadProgress : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The download phase. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The download phase.", + SerializedName = @"downloadPhase", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase? DownloadPhase { get; set; } + /// Number of updates downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of updates downloaded.", + SerializedName = @"numberOfUpdatesDownloaded", + PossibleTypes = new [] { typeof(int) })] + int? NumberOfUpdatesDownloaded { get; set; } + /// Number of updates to download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of updates to download.", + SerializedName = @"numberOfUpdatesToDownload", + PossibleTypes = new [] { typeof(int) })] + int? NumberOfUpdatesToDownload { get; set; } + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Percentage of completion.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int? PercentComplete { get; set; } + /// Total bytes downloaded. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total bytes downloaded.", + SerializedName = @"totalBytesDownloaded", + PossibleTypes = new [] { typeof(double) })] + double? TotalBytesDownloaded { get; set; } + /// Total bytes to download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Total bytes to download.", + SerializedName = @"totalBytesToDownload", + PossibleTypes = new [] { typeof(double) })] + double? TotalBytesToDownload { get; set; } + + } + /// details available during the download + internal partial interface IUpdateDownloadProgressInternal + + { + /// The download phase. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase? DownloadPhase { get; set; } + /// Number of updates downloaded. + int? NumberOfUpdatesDownloaded { get; set; } + /// Number of updates to download. + int? NumberOfUpdatesToDownload { get; set; } + /// Percentage of completion. + int? PercentComplete { get; set; } + /// Total bytes downloaded. + double? TotalBytesDownloaded { get; set; } + /// Total bytes to download. + double? TotalBytesToDownload { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateDownloadProgress.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateDownloadProgress.json.cs new file mode 100644 index 000000000000..56a24ccf9ad8 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateDownloadProgress.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// details available during the download + public partial class UpdateDownloadProgress + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateDownloadProgress FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new UpdateDownloadProgress(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._downloadPhase)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._downloadPhase.ToString()) : null, "downloadPhase" ,container.Add ); + AddIf( null != this._percentComplete ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._percentComplete) : null, "percentComplete" ,container.Add ); + AddIf( null != this._totalBytesToDownload ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((double)this._totalBytesToDownload) : null, "totalBytesToDownload" ,container.Add ); + AddIf( null != this._totalBytesDownloaded ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((double)this._totalBytesDownloaded) : null, "totalBytesDownloaded" ,container.Add ); + AddIf( null != this._numberOfUpdatesToDownload ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._numberOfUpdatesToDownload) : null, "numberOfUpdatesToDownload" ,container.Add ); + AddIf( null != this._numberOfUpdatesDownloaded ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._numberOfUpdatesDownloaded) : null, "numberOfUpdatesDownloaded" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal UpdateDownloadProgress(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_downloadPhase = If( json?.PropertyT("downloadPhase"), out var __jsonDownloadPhase) ? (string)__jsonDownloadPhase : (string)DownloadPhase;} + {_percentComplete = If( json?.PropertyT("percentComplete"), out var __jsonPercentComplete) ? (int?)__jsonPercentComplete : PercentComplete;} + {_totalBytesToDownload = If( json?.PropertyT("totalBytesToDownload"), out var __jsonTotalBytesToDownload) ? (double?)__jsonTotalBytesToDownload : TotalBytesToDownload;} + {_totalBytesDownloaded = If( json?.PropertyT("totalBytesDownloaded"), out var __jsonTotalBytesDownloaded) ? (double?)__jsonTotalBytesDownloaded : TotalBytesDownloaded;} + {_numberOfUpdatesToDownload = If( json?.PropertyT("numberOfUpdatesToDownload"), out var __jsonNumberOfUpdatesToDownload) ? (int?)__jsonNumberOfUpdatesToDownload : NumberOfUpdatesToDownload;} + {_numberOfUpdatesDownloaded = If( json?.PropertyT("numberOfUpdatesDownloaded"), out var __jsonNumberOfUpdatesDownloaded) ? (int?)__jsonNumberOfUpdatesDownloaded : NumberOfUpdatesDownloaded;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateInstallProgress.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateInstallProgress.PowerShell.cs new file mode 100644 index 000000000000..a0d5a6e56722 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateInstallProgress.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Class representing the progress during installation of updates + [System.ComponentModel.TypeConverter(typeof(UpdateInstallProgressTypeConverter))] + public partial class UpdateInstallProgress + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UpdateInstallProgress(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UpdateInstallProgress(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UpdateInstallProgress(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)this).PercentComplete = (int?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)this).PercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfUpdatesToInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)this).NumberOfUpdatesToInstall = (int?) content.GetValueForProperty("NumberOfUpdatesToInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)this).NumberOfUpdatesToInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfUpdatesInstalled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)this).NumberOfUpdatesInstalled = (int?) content.GetValueForProperty("NumberOfUpdatesInstalled",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)this).NumberOfUpdatesInstalled, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UpdateInstallProgress(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)this).PercentComplete = (int?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)this).PercentComplete, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfUpdatesToInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)this).NumberOfUpdatesToInstall = (int?) content.GetValueForProperty("NumberOfUpdatesToInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)this).NumberOfUpdatesToInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NumberOfUpdatesInstalled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)this).NumberOfUpdatesInstalled = (int?) content.GetValueForProperty("NumberOfUpdatesInstalled",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal)this).NumberOfUpdatesInstalled, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + } + /// Class representing the progress during installation of updates + [System.ComponentModel.TypeConverter(typeof(UpdateInstallProgressTypeConverter))] + public partial interface IUpdateInstallProgress + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateInstallProgress.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateInstallProgress.TypeConverter.cs new file mode 100644 index 000000000000..9a89b3077edf --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateInstallProgress.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UpdateInstallProgressTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UpdateInstallProgress.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UpdateInstallProgress.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UpdateInstallProgress.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateInstallProgress.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateInstallProgress.cs new file mode 100644 index 000000000000..d9fce3441869 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateInstallProgress.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class representing the progress during installation of updates + public partial class UpdateInstallProgress : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgressInternal + { + + /// Backing field for property. + private int? _numberOfUpdatesInstalled; + + /// Number of updates installed. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? NumberOfUpdatesInstalled { get => this._numberOfUpdatesInstalled; set => this._numberOfUpdatesInstalled = value; } + + /// Backing field for property. + private int? _numberOfUpdatesToInstall; + + /// Number of updates to install. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? NumberOfUpdatesToInstall { get => this._numberOfUpdatesToInstall; set => this._numberOfUpdatesToInstall = value; } + + /// Backing field for property. + private int? _percentComplete; + + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? PercentComplete { get => this._percentComplete; set => this._percentComplete = value; } + + /// Creates an new instance. + public UpdateInstallProgress() + { + + } + } + /// Class representing the progress during installation of updates + public partial interface IUpdateInstallProgress : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Number of updates installed. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of updates installed.", + SerializedName = @"numberOfUpdatesInstalled", + PossibleTypes = new [] { typeof(int) })] + int? NumberOfUpdatesInstalled { get; set; } + /// Number of updates to install. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of updates to install.", + SerializedName = @"numberOfUpdatesToInstall", + PossibleTypes = new [] { typeof(int) })] + int? NumberOfUpdatesToInstall { get; set; } + /// Percentage of completion. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Percentage of completion.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(int) })] + int? PercentComplete { get; set; } + + } + /// Class representing the progress during installation of updates + internal partial interface IUpdateInstallProgressInternal + + { + /// Number of updates installed. + int? NumberOfUpdatesInstalled { get; set; } + /// Number of updates to install. + int? NumberOfUpdatesToInstall { get; set; } + /// Percentage of completion. + int? PercentComplete { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateInstallProgress.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateInstallProgress.json.cs new file mode 100644 index 000000000000..6fd45970cbd2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdateInstallProgress.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Class representing the progress during installation of updates + public partial class UpdateInstallProgress + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdateInstallProgress FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new UpdateInstallProgress(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._percentComplete ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._percentComplete) : null, "percentComplete" ,container.Add ); + AddIf( null != this._numberOfUpdatesToInstall ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._numberOfUpdatesToInstall) : null, "numberOfUpdatesToInstall" ,container.Add ); + AddIf( null != this._numberOfUpdatesInstalled ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._numberOfUpdatesInstalled) : null, "numberOfUpdatesInstalled" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal UpdateInstallProgress(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_percentComplete = If( json?.PropertyT("percentComplete"), out var __jsonPercentComplete) ? (int?)__jsonPercentComplete : PercentComplete;} + {_numberOfUpdatesToInstall = If( json?.PropertyT("numberOfUpdatesToInstall"), out var __jsonNumberOfUpdatesToInstall) ? (int?)__jsonNumberOfUpdatesToInstall : NumberOfUpdatesToInstall;} + {_numberOfUpdatesInstalled = If( json?.PropertyT("numberOfUpdatesInstalled"), out var __jsonNumberOfUpdatesInstalled) ? (int?)__jsonNumberOfUpdatesInstalled : NumberOfUpdatesInstalled;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Updates.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Updates.PowerShell.cs new file mode 100644 index 000000000000..e22a3090f383 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Updates.PowerShell.cs @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// The updates profile + [System.ComponentModel.TypeConverter(typeof(UpdatesTypeConverter))] + public partial class Updates + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Updates(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Updates(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Updates(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdatesPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DeviceVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).DeviceVersion = (string) content.GetValueForProperty("DeviceVersion",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).DeviceVersion, global::System.Convert.ToString); + } + if (content.Contains("DeviceLastScannedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).DeviceLastScannedTime = (global::System.DateTime?) content.GetValueForProperty("DeviceLastScannedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).DeviceLastScannedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RegularUpdatesAvailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).RegularUpdatesAvailable = (bool?) content.GetValueForProperty("RegularUpdatesAvailable",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).RegularUpdatesAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RebootRequiredForInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).RebootRequiredForInstall = (bool?) content.GetValueForProperty("RebootRequiredForInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).RebootRequiredForInstall, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TotalItemsPendingForDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).TotalItemsPendingForDownload = (int?) content.GetValueForProperty("TotalItemsPendingForDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).TotalItemsPendingForDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalItemsPendingForInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).TotalItemsPendingForInstall = (int?) content.GetValueForProperty("TotalItemsPendingForInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).TotalItemsPendingForInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation.CreateFrom); + } + if (content.Contains("LastCompletedScanTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).LastCompletedScanTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedScanTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).LastCompletedScanTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedDownloadJobTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).LastCompletedDownloadJobTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedDownloadJobTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).LastCompletedDownloadJobTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedInstallJobTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).LastCompletedInstallJobTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedInstallJobTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).LastCompletedInstallJobTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressDownloadJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressDownloadJobId = (string) content.GetValueForProperty("InProgressDownloadJobId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressDownloadJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressInstallJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressInstallJobId = (string) content.GetValueForProperty("InProgressInstallJobId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressInstallJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressScanStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("InProgressScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressScanStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressDownloadJobStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressDownloadJobStartedTime = (global::System.DateTime?) content.GetValueForProperty("InProgressDownloadJobStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressDownloadJobStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressInstallJobStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressInstallJobStartedTime = (global::System.DateTime?) content.GetValueForProperty("InProgressInstallJobStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressInstallJobStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Updates(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdatesPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DeviceVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).DeviceVersion = (string) content.GetValueForProperty("DeviceVersion",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).DeviceVersion, global::System.Convert.ToString); + } + if (content.Contains("DeviceLastScannedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).DeviceLastScannedTime = (global::System.DateTime?) content.GetValueForProperty("DeviceLastScannedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).DeviceLastScannedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RegularUpdatesAvailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).RegularUpdatesAvailable = (bool?) content.GetValueForProperty("RegularUpdatesAvailable",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).RegularUpdatesAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RebootRequiredForInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).RebootRequiredForInstall = (bool?) content.GetValueForProperty("RebootRequiredForInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).RebootRequiredForInstall, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TotalItemsPendingForDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).TotalItemsPendingForDownload = (int?) content.GetValueForProperty("TotalItemsPendingForDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).TotalItemsPendingForDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalItemsPendingForInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).TotalItemsPendingForInstall = (int?) content.GetValueForProperty("TotalItemsPendingForInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).TotalItemsPendingForInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation.CreateFrom); + } + if (content.Contains("LastCompletedScanTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).LastCompletedScanTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedScanTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).LastCompletedScanTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedDownloadJobTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).LastCompletedDownloadJobTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedDownloadJobTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).LastCompletedDownloadJobTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedInstallJobTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).LastCompletedInstallJobTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedInstallJobTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).LastCompletedInstallJobTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressDownloadJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressDownloadJobId = (string) content.GetValueForProperty("InProgressDownloadJobId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressDownloadJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressInstallJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressInstallJobId = (string) content.GetValueForProperty("InProgressInstallJobId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressInstallJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressScanStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("InProgressScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressScanStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressDownloadJobStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressDownloadJobStartedTime = (global::System.DateTime?) content.GetValueForProperty("InProgressDownloadJobStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressDownloadJobStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressInstallJobStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressInstallJobStartedTime = (global::System.DateTime?) content.GetValueForProperty("InProgressInstallJobStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal)this).InProgressInstallJobStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + } + /// The updates profile + [System.ComponentModel.TypeConverter(typeof(UpdatesTypeConverter))] + public partial interface IUpdates + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Updates.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Updates.TypeConverter.cs new file mode 100644 index 000000000000..fdaa610d2157 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Updates.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UpdatesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Updates.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Updates.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Updates.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Updates.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Updates.cs new file mode 100644 index 000000000000..387a86cfd7c0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Updates.cs @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The updates profile + public partial class Updates : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// The last time when the device did an update scan. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime? DeviceLastScannedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).DeviceLastScannedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).DeviceLastScannedTime = value ?? default(global::System.DateTime); } + + /// The current Device version. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string DeviceVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).DeviceVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).DeviceVersion = value ?? null; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// + /// If a download is in progress, this field contains the JobId of that particular download job + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string InProgressDownloadJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).InProgressDownloadJobId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).InProgressDownloadJobId = value ?? null; } + + /// The time when the currently running download (if any) started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime? InProgressDownloadJobStartedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).InProgressDownloadJobStartedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).InProgressDownloadJobStartedTime = value ?? default(global::System.DateTime); } + + /// + /// If an install is in progress, this field contains the JobId of that particular install job + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string InProgressInstallJobId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).InProgressInstallJobId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).InProgressInstallJobId = value ?? null; } + + /// The time when the currently running install (if any) started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime? InProgressInstallJobStartedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).InProgressInstallJobStartedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).InProgressInstallJobStartedTime = value ?? default(global::System.DateTime); } + + /// The time when the currently running scan (if any) started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime? InProgressScanStartedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).InProgressScanStartedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).InProgressScanStartedTime = value ?? default(global::System.DateTime); } + + /// + /// The time when the last Download job was completed (success|cancelled|failed) on the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime? LastCompletedDownloadJobTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).LastCompletedDownloadJobTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).LastCompletedDownloadJobTime = value ?? default(global::System.DateTime); } + + /// + /// The time when the last Install job was completed (success|cancelled|failed) on the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime? LastCompletedInstallJobTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).LastCompletedInstallJobTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).LastCompletedInstallJobTime = value ?? default(global::System.DateTime); } + + /// + /// The time when the last scan job was completed (success|cancelled|failed) on the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime? LastCompletedScanTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).LastCompletedScanTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).LastCompletedScanTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdatesProperties()); set { {_property = value;} } } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties _property; + + /// Update properties. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdatesProperties()); set => this._property = value; } + + /// + /// Set to true if RegularUpdatesAvailable is true and if at least one of the updateItems detected has needs a reboot to install. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public bool? RebootRequiredForInstall { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).RebootRequiredForInstall; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).RebootRequiredForInstall = value ?? default(bool); } + + /// + /// Set to true if regular updates were detected for the current version of the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public bool? RegularUpdatesAvailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).RegularUpdatesAvailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).RegularUpdatesAvailable = value ?? default(bool); } + + /// The current update operation. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation)""); } + + /// The total number of items pending for download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? TotalItemsPendingForDownload { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).TotalItemsPendingForDownload; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).TotalItemsPendingForDownload = value ?? default(int); } + + /// The total number of items pending for install. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public int? TotalItemsPendingForInstall { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).TotalItemsPendingForInstall; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)Property).TotalItemsPendingForInstall = value ?? default(int); } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Creates an new instance. + public Updates() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// The updates profile + public partial interface IUpdates : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// The last time when the device did an update scan. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The last time when the device did an update scan.", + SerializedName = @"deviceLastScannedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DeviceLastScannedTime { get; set; } + /// The current Device version. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The current Device version.", + SerializedName = @"deviceVersion", + PossibleTypes = new [] { typeof(string) })] + string DeviceVersion { get; set; } + /// + /// If a download is in progress, this field contains the JobId of that particular download job + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If a download is in progress, this field contains the JobId of that particular download job", + SerializedName = @"inProgressDownloadJobId", + PossibleTypes = new [] { typeof(string) })] + string InProgressDownloadJobId { get; set; } + /// The time when the currently running download (if any) started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the currently running download (if any) started", + SerializedName = @"inProgressDownloadJobStartedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? InProgressDownloadJobStartedTime { get; set; } + /// + /// If an install is in progress, this field contains the JobId of that particular install job + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If an install is in progress, this field contains the JobId of that particular install job", + SerializedName = @"inProgressInstallJobId", + PossibleTypes = new [] { typeof(string) })] + string InProgressInstallJobId { get; set; } + /// The time when the currently running install (if any) started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the currently running install (if any) started", + SerializedName = @"inProgressInstallJobStartedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? InProgressInstallJobStartedTime { get; set; } + /// The time when the currently running scan (if any) started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the currently running scan (if any) started", + SerializedName = @"inProgressScanStartedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? InProgressScanStartedTime { get; set; } + /// + /// The time when the last Download job was completed (success|cancelled|failed) on the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the last Download job was completed (success|cancelled|failed) on the device.", + SerializedName = @"lastCompletedDownloadJobTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastCompletedDownloadJobTime { get; set; } + /// + /// The time when the last Install job was completed (success|cancelled|failed) on the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the last Install job was completed (success|cancelled|failed) on the device.", + SerializedName = @"lastCompletedInstallJobTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastCompletedInstallJobTime { get; set; } + /// + /// The time when the last scan job was completed (success|cancelled|failed) on the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the last scan job was completed (success|cancelled|failed) on the device.", + SerializedName = @"lastCompletedScanTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastCompletedScanTime { get; set; } + /// + /// Set to true if RegularUpdatesAvailable is true and if at least one of the updateItems detected has needs a reboot to install. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to true if RegularUpdatesAvailable is true and if at least one of the updateItems detected has needs a reboot to install.", + SerializedName = @"rebootRequiredForInstall", + PossibleTypes = new [] { typeof(bool) })] + bool? RebootRequiredForInstall { get; set; } + /// + /// Set to true if regular updates were detected for the current version of the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to true if regular updates were detected for the current version of the device.", + SerializedName = @"regularUpdatesAvailable", + PossibleTypes = new [] { typeof(bool) })] + bool? RegularUpdatesAvailable { get; set; } + /// The current update operation. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The current update operation.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation? Status { get; set; } + /// The total number of items pending for download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total number of items pending for download.", + SerializedName = @"totalItemsPendingForDownload", + PossibleTypes = new [] { typeof(int) })] + int? TotalItemsPendingForDownload { get; set; } + /// The total number of items pending for install. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total number of items pending for install.", + SerializedName = @"totalItemsPendingForInstall", + PossibleTypes = new [] { typeof(int) })] + int? TotalItemsPendingForInstall { get; set; } + + } + /// The updates profile + internal partial interface IUpdatesInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// The last time when the device did an update scan. + global::System.DateTime? DeviceLastScannedTime { get; set; } + /// The current Device version. + string DeviceVersion { get; set; } + /// + /// If a download is in progress, this field contains the JobId of that particular download job + /// + string InProgressDownloadJobId { get; set; } + /// The time when the currently running download (if any) started + global::System.DateTime? InProgressDownloadJobStartedTime { get; set; } + /// + /// If an install is in progress, this field contains the JobId of that particular install job + /// + string InProgressInstallJobId { get; set; } + /// The time when the currently running install (if any) started + global::System.DateTime? InProgressInstallJobStartedTime { get; set; } + /// The time when the currently running scan (if any) started + global::System.DateTime? InProgressScanStartedTime { get; set; } + /// + /// The time when the last Download job was completed (success|cancelled|failed) on the device. + /// + global::System.DateTime? LastCompletedDownloadJobTime { get; set; } + /// + /// The time when the last Install job was completed (success|cancelled|failed) on the device. + /// + global::System.DateTime? LastCompletedInstallJobTime { get; set; } + /// + /// The time when the last scan job was completed (success|cancelled|failed) on the device. + /// + global::System.DateTime? LastCompletedScanTime { get; set; } + /// Update properties. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties Property { get; set; } + /// + /// Set to true if RegularUpdatesAvailable is true and if at least one of the updateItems detected has needs a reboot to install. + /// + bool? RebootRequiredForInstall { get; set; } + /// + /// Set to true if regular updates were detected for the current version of the device. + /// + bool? RegularUpdatesAvailable { get; set; } + /// The current update operation. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation? Status { get; set; } + /// The total number of items pending for download. + int? TotalItemsPendingForDownload { get; set; } + /// The total number of items pending for install. + int? TotalItemsPendingForInstall { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Updates.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Updates.json.cs new file mode 100644 index 000000000000..ba2493d97b3b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/Updates.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// The updates profile + public partial class Updates + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new Updates(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal Updates(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UpdatesProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdatesProperties.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdatesProperties.PowerShell.cs new file mode 100644 index 000000000000..efa5ea775e7a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdatesProperties.PowerShell.cs @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Properties of the update profile + [System.ComponentModel.TypeConverter(typeof(UpdatesPropertiesTypeConverter))] + public partial class UpdatesProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UpdatesProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UpdatesProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UpdatesProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DeviceVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).DeviceVersion = (string) content.GetValueForProperty("DeviceVersion",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).DeviceVersion, global::System.Convert.ToString); + } + if (content.Contains("DeviceLastScannedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).DeviceLastScannedTime = (global::System.DateTime?) content.GetValueForProperty("DeviceLastScannedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).DeviceLastScannedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RegularUpdatesAvailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).RegularUpdatesAvailable = (bool?) content.GetValueForProperty("RegularUpdatesAvailable",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).RegularUpdatesAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RebootRequiredForInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).RebootRequiredForInstall = (bool?) content.GetValueForProperty("RebootRequiredForInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).RebootRequiredForInstall, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TotalItemsPendingForDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).TotalItemsPendingForDownload = (int?) content.GetValueForProperty("TotalItemsPendingForDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).TotalItemsPendingForDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalItemsPendingForInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).TotalItemsPendingForInstall = (int?) content.GetValueForProperty("TotalItemsPendingForInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).TotalItemsPendingForInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation.CreateFrom); + } + if (content.Contains("LastCompletedScanTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).LastCompletedScanTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedScanTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).LastCompletedScanTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedDownloadJobTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).LastCompletedDownloadJobTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedDownloadJobTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).LastCompletedDownloadJobTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedInstallJobTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).LastCompletedInstallJobTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedInstallJobTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).LastCompletedInstallJobTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressDownloadJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressDownloadJobId = (string) content.GetValueForProperty("InProgressDownloadJobId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressDownloadJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressInstallJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressInstallJobId = (string) content.GetValueForProperty("InProgressInstallJobId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressInstallJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressScanStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("InProgressScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressScanStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressDownloadJobStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressDownloadJobStartedTime = (global::System.DateTime?) content.GetValueForProperty("InProgressDownloadJobStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressDownloadJobStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressInstallJobStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressInstallJobStartedTime = (global::System.DateTime?) content.GetValueForProperty("InProgressInstallJobStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressInstallJobStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UpdatesProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DeviceVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).DeviceVersion = (string) content.GetValueForProperty("DeviceVersion",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).DeviceVersion, global::System.Convert.ToString); + } + if (content.Contains("DeviceLastScannedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).DeviceLastScannedTime = (global::System.DateTime?) content.GetValueForProperty("DeviceLastScannedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).DeviceLastScannedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RegularUpdatesAvailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).RegularUpdatesAvailable = (bool?) content.GetValueForProperty("RegularUpdatesAvailable",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).RegularUpdatesAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RebootRequiredForInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).RebootRequiredForInstall = (bool?) content.GetValueForProperty("RebootRequiredForInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).RebootRequiredForInstall, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TotalItemsPendingForDownload")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).TotalItemsPendingForDownload = (int?) content.GetValueForProperty("TotalItemsPendingForDownload",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).TotalItemsPendingForDownload, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TotalItemsPendingForInstall")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).TotalItemsPendingForInstall = (int?) content.GetValueForProperty("TotalItemsPendingForInstall",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).TotalItemsPendingForInstall, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation.CreateFrom); + } + if (content.Contains("LastCompletedScanTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).LastCompletedScanTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedScanTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).LastCompletedScanTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedDownloadJobTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).LastCompletedDownloadJobTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedDownloadJobTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).LastCompletedDownloadJobTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastCompletedInstallJobTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).LastCompletedInstallJobTime = (global::System.DateTime?) content.GetValueForProperty("LastCompletedInstallJobTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).LastCompletedInstallJobTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressDownloadJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressDownloadJobId = (string) content.GetValueForProperty("InProgressDownloadJobId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressDownloadJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressInstallJobId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressInstallJobId = (string) content.GetValueForProperty("InProgressInstallJobId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressInstallJobId, global::System.Convert.ToString); + } + if (content.Contains("InProgressScanStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("InProgressScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressScanStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressDownloadJobStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressDownloadJobStartedTime = (global::System.DateTime?) content.GetValueForProperty("InProgressDownloadJobStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressDownloadJobStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("InProgressInstallJobStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressInstallJobStartedTime = (global::System.DateTime?) content.GetValueForProperty("InProgressInstallJobStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal)this).InProgressInstallJobStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + } + /// Properties of the update profile + [System.ComponentModel.TypeConverter(typeof(UpdatesPropertiesTypeConverter))] + public partial interface IUpdatesProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdatesProperties.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdatesProperties.TypeConverter.cs new file mode 100644 index 000000000000..c5986f262526 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdatesProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UpdatesPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UpdatesProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UpdatesProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UpdatesProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdatesProperties.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdatesProperties.cs new file mode 100644 index 000000000000..f87577d9bc24 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdatesProperties.cs @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Properties of the update profile + public partial class UpdatesProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesPropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime? _deviceLastScannedTime; + + /// The last time when the device did an update scan. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? DeviceLastScannedTime { get => this._deviceLastScannedTime; set => this._deviceLastScannedTime = value; } + + /// Backing field for property. + private string _deviceVersion; + + /// The current Device version. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string DeviceVersion { get => this._deviceVersion; set => this._deviceVersion = value; } + + /// Backing field for property. + private string _inProgressDownloadJobId; + + /// + /// If a download is in progress, this field contains the JobId of that particular download job + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string InProgressDownloadJobId { get => this._inProgressDownloadJobId; set => this._inProgressDownloadJobId = value; } + + /// Backing field for property. + private global::System.DateTime? _inProgressDownloadJobStartedTime; + + /// The time when the currently running download (if any) started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? InProgressDownloadJobStartedTime { get => this._inProgressDownloadJobStartedTime; set => this._inProgressDownloadJobStartedTime = value; } + + /// Backing field for property. + private string _inProgressInstallJobId; + + /// + /// If an install is in progress, this field contains the JobId of that particular install job + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string InProgressInstallJobId { get => this._inProgressInstallJobId; set => this._inProgressInstallJobId = value; } + + /// Backing field for property. + private global::System.DateTime? _inProgressInstallJobStartedTime; + + /// The time when the currently running install (if any) started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? InProgressInstallJobStartedTime { get => this._inProgressInstallJobStartedTime; set => this._inProgressInstallJobStartedTime = value; } + + /// Backing field for property. + private global::System.DateTime? _inProgressScanStartedTime; + + /// The time when the currently running scan (if any) started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? InProgressScanStartedTime { get => this._inProgressScanStartedTime; set => this._inProgressScanStartedTime = value; } + + /// Backing field for property. + private global::System.DateTime? _lastCompletedDownloadJobTime; + + /// + /// The time when the last Download job was completed (success|cancelled|failed) on the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? LastCompletedDownloadJobTime { get => this._lastCompletedDownloadJobTime; set => this._lastCompletedDownloadJobTime = value; } + + /// Backing field for property. + private global::System.DateTime? _lastCompletedInstallJobTime; + + /// + /// The time when the last Install job was completed (success|cancelled|failed) on the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? LastCompletedInstallJobTime { get => this._lastCompletedInstallJobTime; set => this._lastCompletedInstallJobTime = value; } + + /// Backing field for property. + private global::System.DateTime? _lastCompletedScanTime; + + /// + /// The time when the last scan job was completed (success|cancelled|failed) on the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public global::System.DateTime? LastCompletedScanTime { get => this._lastCompletedScanTime; set => this._lastCompletedScanTime = value; } + + /// Backing field for property. + private bool? _rebootRequiredForInstall; + + /// + /// Set to true if RegularUpdatesAvailable is true and if at least one of the updateItems detected has needs a reboot to install. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public bool? RebootRequiredForInstall { get => this._rebootRequiredForInstall; set => this._rebootRequiredForInstall = value; } + + /// Backing field for property. + private bool? _regularUpdatesAvailable; + + /// + /// Set to true if regular updates were detected for the current version of the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public bool? RegularUpdatesAvailable { get => this._regularUpdatesAvailable; set => this._regularUpdatesAvailable = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation? _status; + + /// The current update operation. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation? Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private int? _totalItemsPendingForDownload; + + /// The total number of items pending for download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? TotalItemsPendingForDownload { get => this._totalItemsPendingForDownload; set => this._totalItemsPendingForDownload = value; } + + /// Backing field for property. + private int? _totalItemsPendingForInstall; + + /// The total number of items pending for install. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public int? TotalItemsPendingForInstall { get => this._totalItemsPendingForInstall; set => this._totalItemsPendingForInstall = value; } + + /// Creates an new instance. + public UpdatesProperties() + { + + } + } + /// Properties of the update profile + public partial interface IUpdatesProperties : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// The last time when the device did an update scan. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The last time when the device did an update scan.", + SerializedName = @"deviceLastScannedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DeviceLastScannedTime { get; set; } + /// The current Device version. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The current Device version.", + SerializedName = @"deviceVersion", + PossibleTypes = new [] { typeof(string) })] + string DeviceVersion { get; set; } + /// + /// If a download is in progress, this field contains the JobId of that particular download job + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If a download is in progress, this field contains the JobId of that particular download job", + SerializedName = @"inProgressDownloadJobId", + PossibleTypes = new [] { typeof(string) })] + string InProgressDownloadJobId { get; set; } + /// The time when the currently running download (if any) started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the currently running download (if any) started", + SerializedName = @"inProgressDownloadJobStartedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? InProgressDownloadJobStartedTime { get; set; } + /// + /// If an install is in progress, this field contains the JobId of that particular install job + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If an install is in progress, this field contains the JobId of that particular install job", + SerializedName = @"inProgressInstallJobId", + PossibleTypes = new [] { typeof(string) })] + string InProgressInstallJobId { get; set; } + /// The time when the currently running install (if any) started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the currently running install (if any) started", + SerializedName = @"inProgressInstallJobStartedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? InProgressInstallJobStartedTime { get; set; } + /// The time when the currently running scan (if any) started + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the currently running scan (if any) started", + SerializedName = @"inProgressScanStartedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? InProgressScanStartedTime { get; set; } + /// + /// The time when the last Download job was completed (success|cancelled|failed) on the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the last Download job was completed (success|cancelled|failed) on the device.", + SerializedName = @"lastCompletedDownloadJobTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastCompletedDownloadJobTime { get; set; } + /// + /// The time when the last Install job was completed (success|cancelled|failed) on the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the last Install job was completed (success|cancelled|failed) on the device.", + SerializedName = @"lastCompletedInstallJobTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastCompletedInstallJobTime { get; set; } + /// + /// The time when the last scan job was completed (success|cancelled|failed) on the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the last scan job was completed (success|cancelled|failed) on the device.", + SerializedName = @"lastCompletedScanTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastCompletedScanTime { get; set; } + /// + /// Set to true if RegularUpdatesAvailable is true and if at least one of the updateItems detected has needs a reboot to install. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to true if RegularUpdatesAvailable is true and if at least one of the updateItems detected has needs a reboot to install.", + SerializedName = @"rebootRequiredForInstall", + PossibleTypes = new [] { typeof(bool) })] + bool? RebootRequiredForInstall { get; set; } + /// + /// Set to true if regular updates were detected for the current version of the device. + /// + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to true if regular updates were detected for the current version of the device.", + SerializedName = @"regularUpdatesAvailable", + PossibleTypes = new [] { typeof(bool) })] + bool? RegularUpdatesAvailable { get; set; } + /// The current update operation. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The current update operation.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation? Status { get; set; } + /// The total number of items pending for download. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total number of items pending for download.", + SerializedName = @"totalItemsPendingForDownload", + PossibleTypes = new [] { typeof(int) })] + int? TotalItemsPendingForDownload { get; set; } + /// The total number of items pending for install. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total number of items pending for install.", + SerializedName = @"totalItemsPendingForInstall", + PossibleTypes = new [] { typeof(int) })] + int? TotalItemsPendingForInstall { get; set; } + + } + /// Properties of the update profile + internal partial interface IUpdatesPropertiesInternal + + { + /// The last time when the device did an update scan. + global::System.DateTime? DeviceLastScannedTime { get; set; } + /// The current Device version. + string DeviceVersion { get; set; } + /// + /// If a download is in progress, this field contains the JobId of that particular download job + /// + string InProgressDownloadJobId { get; set; } + /// The time when the currently running download (if any) started + global::System.DateTime? InProgressDownloadJobStartedTime { get; set; } + /// + /// If an install is in progress, this field contains the JobId of that particular install job + /// + string InProgressInstallJobId { get; set; } + /// The time when the currently running install (if any) started + global::System.DateTime? InProgressInstallJobStartedTime { get; set; } + /// The time when the currently running scan (if any) started + global::System.DateTime? InProgressScanStartedTime { get; set; } + /// + /// The time when the last Download job was completed (success|cancelled|failed) on the device. + /// + global::System.DateTime? LastCompletedDownloadJobTime { get; set; } + /// + /// The time when the last Install job was completed (success|cancelled|failed) on the device. + /// + global::System.DateTime? LastCompletedInstallJobTime { get; set; } + /// + /// The time when the last scan job was completed (success|cancelled|failed) on the device. + /// + global::System.DateTime? LastCompletedScanTime { get; set; } + /// + /// Set to true if RegularUpdatesAvailable is true and if at least one of the updateItems detected has needs a reboot to install. + /// + bool? RebootRequiredForInstall { get; set; } + /// + /// Set to true if regular updates were detected for the current version of the device. + /// + bool? RegularUpdatesAvailable { get; set; } + /// The current update operation. + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation? Status { get; set; } + /// The total number of items pending for download. + int? TotalItemsPendingForDownload { get; set; } + /// The total number of items pending for install. + int? TotalItemsPendingForInstall { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdatesProperties.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdatesProperties.json.cs new file mode 100644 index 000000000000..fc85d9203a67 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UpdatesProperties.json.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Properties of the update profile + public partial class UpdatesProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdatesProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new UpdatesProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._deviceVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._deviceVersion.ToString()) : null, "deviceVersion" ,container.Add ); + AddIf( null != this._deviceLastScannedTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._deviceLastScannedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "deviceLastScannedTime" ,container.Add ); + AddIf( null != this._regularUpdatesAvailable ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonBoolean((bool)this._regularUpdatesAvailable) : null, "regularUpdatesAvailable" ,container.Add ); + AddIf( null != this._rebootRequiredForInstall ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonBoolean((bool)this._rebootRequiredForInstall) : null, "rebootRequiredForInstall" ,container.Add ); + AddIf( null != this._totalItemsPendingForDownload ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._totalItemsPendingForDownload) : null, "totalItemsPendingForDownload" ,container.Add ); + AddIf( null != this._totalItemsPendingForInstall ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNumber((int)this._totalItemsPendingForInstall) : null, "totalItemsPendingForInstall" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != this._lastCompletedScanTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._lastCompletedScanTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastCompletedScanTime" ,container.Add ); + AddIf( null != this._lastCompletedDownloadJobTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._lastCompletedDownloadJobTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastCompletedDownloadJobTime" ,container.Add ); + AddIf( null != this._lastCompletedInstallJobTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._lastCompletedInstallJobTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastCompletedInstallJobTime" ,container.Add ); + AddIf( null != (((object)this._inProgressDownloadJobId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._inProgressDownloadJobId.ToString()) : null, "inProgressDownloadJobId" ,container.Add ); + AddIf( null != (((object)this._inProgressInstallJobId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._inProgressInstallJobId.ToString()) : null, "inProgressInstallJobId" ,container.Add ); + AddIf( null != this._inProgressScanStartedTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._inProgressScanStartedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "inProgressScanStartedTime" ,container.Add ); + AddIf( null != this._inProgressDownloadJobStartedTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._inProgressDownloadJobStartedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "inProgressDownloadJobStartedTime" ,container.Add ); + AddIf( null != this._inProgressInstallJobStartedTime ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._inProgressInstallJobStartedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "inProgressInstallJobStartedTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal UpdatesProperties(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_deviceVersion = If( json?.PropertyT("deviceVersion"), out var __jsonDeviceVersion) ? (string)__jsonDeviceVersion : (string)DeviceVersion;} + {_deviceLastScannedTime = If( json?.PropertyT("deviceLastScannedTime"), out var __jsonDeviceLastScannedTime) ? global::System.DateTime.TryParse((string)__jsonDeviceLastScannedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDeviceLastScannedTimeValue) ? __jsonDeviceLastScannedTimeValue : DeviceLastScannedTime : DeviceLastScannedTime;} + {_regularUpdatesAvailable = If( json?.PropertyT("regularUpdatesAvailable"), out var __jsonRegularUpdatesAvailable) ? (bool?)__jsonRegularUpdatesAvailable : RegularUpdatesAvailable;} + {_rebootRequiredForInstall = If( json?.PropertyT("rebootRequiredForInstall"), out var __jsonRebootRequiredForInstall) ? (bool?)__jsonRebootRequiredForInstall : RebootRequiredForInstall;} + {_totalItemsPendingForDownload = If( json?.PropertyT("totalItemsPendingForDownload"), out var __jsonTotalItemsPendingForDownload) ? (int?)__jsonTotalItemsPendingForDownload : TotalItemsPendingForDownload;} + {_totalItemsPendingForInstall = If( json?.PropertyT("totalItemsPendingForInstall"), out var __jsonTotalItemsPendingForInstall) ? (int?)__jsonTotalItemsPendingForInstall : TotalItemsPendingForInstall;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_lastCompletedScanTime = If( json?.PropertyT("lastCompletedScanTime"), out var __jsonLastCompletedScanTime) ? global::System.DateTime.TryParse((string)__jsonLastCompletedScanTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastCompletedScanTimeValue) ? __jsonLastCompletedScanTimeValue : LastCompletedScanTime : LastCompletedScanTime;} + {_lastCompletedDownloadJobTime = If( json?.PropertyT("lastCompletedDownloadJobTime"), out var __jsonLastCompletedDownloadJobTime) ? global::System.DateTime.TryParse((string)__jsonLastCompletedDownloadJobTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastCompletedDownloadJobTimeValue) ? __jsonLastCompletedDownloadJobTimeValue : LastCompletedDownloadJobTime : LastCompletedDownloadJobTime;} + {_lastCompletedInstallJobTime = If( json?.PropertyT("lastCompletedInstallJobTime"), out var __jsonLastCompletedInstallJobTime) ? global::System.DateTime.TryParse((string)__jsonLastCompletedInstallJobTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastCompletedInstallJobTimeValue) ? __jsonLastCompletedInstallJobTimeValue : LastCompletedInstallJobTime : LastCompletedInstallJobTime;} + {_inProgressDownloadJobId = If( json?.PropertyT("inProgressDownloadJobId"), out var __jsonInProgressDownloadJobId) ? (string)__jsonInProgressDownloadJobId : (string)InProgressDownloadJobId;} + {_inProgressInstallJobId = If( json?.PropertyT("inProgressInstallJobId"), out var __jsonInProgressInstallJobId) ? (string)__jsonInProgressInstallJobId : (string)InProgressInstallJobId;} + {_inProgressScanStartedTime = If( json?.PropertyT("inProgressScanStartedTime"), out var __jsonInProgressScanStartedTime) ? global::System.DateTime.TryParse((string)__jsonInProgressScanStartedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonInProgressScanStartedTimeValue) ? __jsonInProgressScanStartedTimeValue : InProgressScanStartedTime : InProgressScanStartedTime;} + {_inProgressDownloadJobStartedTime = If( json?.PropertyT("inProgressDownloadJobStartedTime"), out var __jsonInProgressDownloadJobStartedTime) ? global::System.DateTime.TryParse((string)__jsonInProgressDownloadJobStartedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonInProgressDownloadJobStartedTimeValue) ? __jsonInProgressDownloadJobStartedTimeValue : InProgressDownloadJobStartedTime : InProgressDownloadJobStartedTime;} + {_inProgressInstallJobStartedTime = If( json?.PropertyT("inProgressInstallJobStartedTime"), out var __jsonInProgressInstallJobStartedTime) ? global::System.DateTime.TryParse((string)__jsonInProgressInstallJobStartedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonInProgressInstallJobStartedTimeValue) ? __jsonInProgressInstallJobStartedTimeValue : InProgressInstallJobStartedTime : InProgressInstallJobStartedTime;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateRequest.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateRequest.PowerShell.cs new file mode 100644 index 000000000000..74401506efb1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateRequest.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Upload Certificate Request to IDM + [System.ComponentModel.TypeConverter(typeof(UploadCertificateRequestTypeConverter))] + public partial class UploadCertificateRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UploadCertificateRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UploadCertificateRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UploadCertificateRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.RawCertificateDataTypeConverter.ConvertFrom); + } + if (content.Contains("ContractVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).ContractVersion = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions?) content.GetValueForProperty("ContractVersion",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).ContractVersion, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions.CreateFrom); + } + if (content.Contains("AuthType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType.CreateFrom); + } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).Certificate, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UploadCertificateRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.RawCertificateDataTypeConverter.ConvertFrom); + } + if (content.Contains("ContractVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).ContractVersion = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions?) content.GetValueForProperty("ContractVersion",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).ContractVersion, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions.CreateFrom); + } + if (content.Contains("AuthType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType.CreateFrom); + } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal)this).Certificate, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Upload Certificate Request to IDM + [System.ComponentModel.TypeConverter(typeof(UploadCertificateRequestTypeConverter))] + public partial interface IUploadCertificateRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateRequest.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateRequest.TypeConverter.cs new file mode 100644 index 000000000000..6696dd10d302 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateRequest.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UploadCertificateRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UploadCertificateRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UploadCertificateRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UploadCertificateRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateRequest.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateRequest.cs new file mode 100644 index 000000000000..5b0b6e09d710 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateRequest.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Upload Certificate Request to IDM + public partial class UploadCertificateRequest : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal + { + + /// Specify the Authentication type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? AuthType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateDataInternal)Property).AuthType; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateDataInternal)Property).AuthType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType)""); } + + /// Gets or sets the base64 encoded certificate raw data string + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Certificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateDataInternal)Property).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateDataInternal)Property).Certificate = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions? _contractVersion; + + /// Gets ContractVersion + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions? ContractVersion { get => this._contractVersion; } + + /// Internal Acessors for ContractVersion + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal.ContractVersion { get => this._contractVersion; set { {_contractVersion = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.RawCertificateData()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData _property; + + /// Raw Certificate Data From IDM + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.RawCertificateData()); set => this._property = value; } + + /// Creates an new instance. + public UploadCertificateRequest() + { + + } + } + /// Upload Certificate Request to IDM + public partial interface IUploadCertificateRequest : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Specify the Authentication type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify the Authentication type", + SerializedName = @"authType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? AuthType { get; set; } + /// Gets or sets the base64 encoded certificate raw data string + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Gets or sets the base64 encoded certificate raw data string", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + string Certificate { get; set; } + /// Gets ContractVersion + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets ContractVersion", + SerializedName = @"contractVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions? ContractVersion { get; } + + } + /// Upload Certificate Request to IDM + internal partial interface IUploadCertificateRequestInternal + + { + /// Specify the Authentication type + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? AuthType { get; set; } + /// Gets or sets the base64 encoded certificate raw data string + string Certificate { get; set; } + /// Gets ContractVersion + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions? ContractVersion { get; set; } + /// Raw Certificate Data From IDM + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IRawCertificateData Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateRequest.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateRequest.json.cs new file mode 100644 index 000000000000..fe2989d06216 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateRequest.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Upload Certificate Request to IDM + public partial class UploadCertificateRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new UploadCertificateRequest(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._contractVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._contractVersion.ToString()) : null, "contractVersion" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal UploadCertificateRequest(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.RawCertificateData.FromJson(__jsonProperties) : Property;} + {_contractVersion = If( json?.PropertyT("contractVersion"), out var __jsonContractVersion) ? (string)__jsonContractVersion : (string)ContractVersion;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateResponse.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateResponse.PowerShell.cs new file mode 100644 index 000000000000..0a2e92cd76b9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateResponse.PowerShell.cs @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// Upload Certificate Response from IDM + [System.ComponentModel.TypeConverter(typeof(UploadCertificateResponseTypeConverter))] + public partial class UploadCertificateResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UploadCertificateResponse(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UploadCertificateResponse(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UploadCertificateResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceCertificateAndAadDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("AuthType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType.CreateFrom); + } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Certificate, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ResourceId = (long) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ResourceId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AadAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AadAuthority = (string) content.GetValueForProperty("AadAuthority",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AadAuthority, global::System.Convert.ToString); + } + if (content.Contains("AadTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AadTenantId = (string) content.GetValueForProperty("AadTenantId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AadTenantId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ServicePrincipalClientId = (string) content.GetValueForProperty("ServicePrincipalClientId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ServicePrincipalClientId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ServicePrincipalObjectId = (string) content.GetValueForProperty("ServicePrincipalObjectId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ServicePrincipalObjectId, global::System.Convert.ToString); + } + if (content.Contains("AzureManagementEndpointAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AzureManagementEndpointAudience = (string) content.GetValueForProperty("AzureManagementEndpointAudience",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AzureManagementEndpointAudience, global::System.Convert.ToString); + } + if (content.Contains("Subject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Subject = (string) content.GetValueForProperty("Subject",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Subject, global::System.Convert.ToString); + } + if (content.Contains("ValidFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ValidFrom = (global::System.DateTime) content.GetValueForProperty("ValidFrom",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ValidFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ValidTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ValidTo = (global::System.DateTime) content.GetValueForProperty("ValidTo",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ValidTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Thumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Thumbprint = (string) content.GetValueForProperty("Thumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Thumbprint, global::System.Convert.ToString); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("Issuer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Issuer = (string) content.GetValueForProperty("Issuer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Issuer, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UploadCertificateResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceCertificateAndAadDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("AuthType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AuthType = (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType?) content.GetValueForProperty("AuthType",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AuthType, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType.CreateFrom); + } + if (content.Contains("Certificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Certificate = (string) content.GetValueForProperty("Certificate",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Certificate, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ResourceId = (long) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ResourceId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AadAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AadAuthority = (string) content.GetValueForProperty("AadAuthority",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AadAuthority, global::System.Convert.ToString); + } + if (content.Contains("AadTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AadTenantId = (string) content.GetValueForProperty("AadTenantId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AadTenantId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ServicePrincipalClientId = (string) content.GetValueForProperty("ServicePrincipalClientId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ServicePrincipalClientId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ServicePrincipalObjectId = (string) content.GetValueForProperty("ServicePrincipalObjectId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ServicePrincipalObjectId, global::System.Convert.ToString); + } + if (content.Contains("AzureManagementEndpointAudience")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AzureManagementEndpointAudience = (string) content.GetValueForProperty("AzureManagementEndpointAudience",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).AzureManagementEndpointAudience, global::System.Convert.ToString); + } + if (content.Contains("Subject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Subject = (string) content.GetValueForProperty("Subject",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Subject, global::System.Convert.ToString); + } + if (content.Contains("ValidFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ValidFrom = (global::System.DateTime) content.GetValueForProperty("ValidFrom",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ValidFrom, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ValidTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ValidTo = (global::System.DateTime) content.GetValueForProperty("ValidTo",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).ValidTo, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Thumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Thumbprint = (string) content.GetValueForProperty("Thumbprint",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Thumbprint, global::System.Convert.ToString); + } + if (content.Contains("FriendlyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).FriendlyName, global::System.Convert.ToString); + } + if (content.Contains("Issuer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Issuer = (string) content.GetValueForProperty("Issuer",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal)this).Issuer, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Upload Certificate Response from IDM + [System.ComponentModel.TypeConverter(typeof(UploadCertificateResponseTypeConverter))] + public partial interface IUploadCertificateResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateResponse.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateResponse.TypeConverter.cs new file mode 100644 index 000000000000..b6fd95ca4071 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateResponse.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UploadCertificateResponseTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UploadCertificateResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UploadCertificateResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UploadCertificateResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateResponse.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateResponse.cs new file mode 100644 index 000000000000..cee40e8bdc6d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateResponse.cs @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Upload Certificate Response from IDM + public partial class UploadCertificateResponse : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(); + + /// AAD tenant authority + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string AadAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).AadAuthority; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).AadAuthority = value ; } + + /// AAD tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string AadTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).AadTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).AadTenantId = value ; } + + /// Specify the Authentication type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? AuthType { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).AuthType; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).AuthType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType)""); } + + /// Azure Management Endpoint Audience + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string AzureManagementEndpointAudience { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).AzureManagementEndpointAudience; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).AzureManagementEndpointAudience = value ; } + + /// Gets or sets the base64 encoded certificate raw data string + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Certificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).Certificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).Certificate = value ; } + + /// Certificate friendly name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string FriendlyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).FriendlyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).FriendlyName = value ; } + + /// The identifier. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; } + + /// Certificate issuer + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Issuer { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).Issuer; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).Issuer = value ; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceCertificateAndAadDetails()); set { {_property = value;} } } + + /// The name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails _property; + + /// Resource Certificate And AAD Details from IDM + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceCertificateAndAadDetails()); set => this._property = value; } + + /// Gets or Sets the ResourceId + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public long ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).ResourceId = value ; } + + /// AAD service principal clientId + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ServicePrincipalClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).ServicePrincipalClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).ServicePrincipalClientId = value ; } + + /// AAD service principal ObjectId + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string ServicePrincipalObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).ServicePrincipalObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).ServicePrincipalObjectId = value ; } + + /// Certificate Subject Name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Subject { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).Subject; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).Subject = value ; } + + /// Certificate thumbprint + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public string Thumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).Thumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).Thumbprint = value ; } + + /// The type. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal)__baseModel).Type; } + + /// Certificate Validity start Date time + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime ValidFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).ValidFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).ValidFrom = value ; } + + /// Certificate Validity End Date time + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Inlined)] + public global::System.DateTime ValidTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).ValidTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetailsInternal)Property).ValidTo = value ; } + + /// Creates an new instance. + public UploadCertificateResponse() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__baseModel), __baseModel); + await eventListener.AssertObjectIsValid(nameof(__baseModel), __baseModel); + } + } + /// Upload Certificate Response from IDM + public partial interface IUploadCertificateResponse : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModel + { + /// AAD tenant authority + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"AAD tenant authority", + SerializedName = @"aadAuthority", + PossibleTypes = new [] { typeof(string) })] + string AadAuthority { get; set; } + /// AAD tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"AAD tenant Id", + SerializedName = @"aadTenantId", + PossibleTypes = new [] { typeof(string) })] + string AadTenantId { get; set; } + /// Specify the Authentication type + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify the Authentication type", + SerializedName = @"authType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType) })] + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? AuthType { get; set; } + /// Azure Management Endpoint Audience + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Azure Management Endpoint Audience", + SerializedName = @"azureManagementEndpointAudience", + PossibleTypes = new [] { typeof(string) })] + string AzureManagementEndpointAudience { get; set; } + /// Gets or sets the base64 encoded certificate raw data string + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Gets or sets the base64 encoded certificate raw data string", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + string Certificate { get; set; } + /// Certificate friendly name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate friendly name", + SerializedName = @"friendlyName", + PossibleTypes = new [] { typeof(string) })] + string FriendlyName { get; set; } + /// Certificate issuer + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate issuer", + SerializedName = @"issuer", + PossibleTypes = new [] { typeof(string) })] + string Issuer { get; set; } + /// Gets or Sets the ResourceId + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Gets or Sets the ResourceId", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(long) })] + long ResourceId { get; set; } + /// AAD service principal clientId + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"AAD service principal clientId", + SerializedName = @"servicePrincipalClientId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalClientId { get; set; } + /// AAD service principal ObjectId + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"AAD service principal ObjectId", + SerializedName = @"servicePrincipalObjectId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalObjectId { get; set; } + /// Certificate Subject Name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate Subject Name", + SerializedName = @"subject", + PossibleTypes = new [] { typeof(string) })] + string Subject { get; set; } + /// Certificate thumbprint + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate thumbprint", + SerializedName = @"thumbprint", + PossibleTypes = new [] { typeof(string) })] + string Thumbprint { get; set; } + /// Certificate Validity start Date time + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate Validity start Date time", + SerializedName = @"validFrom", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime ValidFrom { get; set; } + /// Certificate Validity End Date time + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate Validity End Date time", + SerializedName = @"validTo", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime ValidTo { get; set; } + + } + /// Upload Certificate Response from IDM + internal partial interface IUploadCertificateResponseInternal : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBaseModelInternal + { + /// AAD tenant authority + string AadAuthority { get; set; } + /// AAD tenant Id + string AadTenantId { get; set; } + /// Specify the Authentication type + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType? AuthType { get; set; } + /// Azure Management Endpoint Audience + string AzureManagementEndpointAudience { get; set; } + /// Gets or sets the base64 encoded certificate raw data string + string Certificate { get; set; } + /// Certificate friendly name + string FriendlyName { get; set; } + /// Certificate issuer + string Issuer { get; set; } + /// Resource Certificate And AAD Details from IDM + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceCertificateAndAadDetails Property { get; set; } + /// Gets or Sets the ResourceId + long ResourceId { get; set; } + /// AAD service principal clientId + string ServicePrincipalClientId { get; set; } + /// AAD service principal ObjectId + string ServicePrincipalObjectId { get; set; } + /// Certificate Subject Name + string Subject { get; set; } + /// Certificate thumbprint + string Thumbprint { get; set; } + /// Certificate Validity start Date time + global::System.DateTime ValidFrom { get; set; } + /// Certificate Validity End Date time + global::System.DateTime ValidTo { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateResponse.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateResponse.json.cs new file mode 100644 index 000000000000..d68c3cf04dd0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/Api20161001/UploadCertificateResponse.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// Upload Certificate Response from IDM + public partial class UploadCertificateResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new UploadCertificateResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __baseModel?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal UploadCertificateResponse(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __baseModel = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BaseModel(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ResourceCertificateAndAadDetails.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/StorSimpleIdentity.PowerShell.cs b/swaggerci/storSimple1200Series/generated/api/Models/StorSimpleIdentity.PowerShell.cs new file mode 100644 index 000000000000..3aa062ae97b1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/StorSimpleIdentity.PowerShell.cs @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(StorSimpleIdentityTypeConverter))] + public partial class StorSimpleIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorSimpleIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorSimpleIdentity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorSimpleIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ManagerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ManagerName = (string) content.GetValueForProperty("ManagerName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ManagerName, global::System.Convert.ToString); + } + if (content.Contains("CertificateName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).CertificateName = (string) content.GetValueForProperty("CertificateName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).CertificateName, global::System.Convert.ToString); + } + if (content.Contains("AccessControlRecordName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).AccessControlRecordName = (string) content.GetValueForProperty("AccessControlRecordName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).AccessControlRecordName, global::System.Convert.ToString); + } + if (content.Contains("DeviceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).DeviceName = (string) content.GetValueForProperty("DeviceName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).DeviceName, global::System.Convert.ToString); + } + if (content.Contains("BackupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).BackupName = (string) content.GetValueForProperty("BackupName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).BackupName, global::System.Convert.ToString); + } + if (content.Contains("ElementName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ElementName = (string) content.GetValueForProperty("ElementName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ElementName, global::System.Convert.ToString); + } + if (content.Contains("ScheduleGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ScheduleGroupName = (string) content.GetValueForProperty("ScheduleGroupName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ScheduleGroupName, global::System.Convert.ToString); + } + if (content.Contains("ChapUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ChapUserName = (string) content.GetValueForProperty("ChapUserName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ChapUserName, global::System.Convert.ToString); + } + if (content.Contains("IscsiServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).IscsiServerName = (string) content.GetValueForProperty("IscsiServerName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).IscsiServerName, global::System.Convert.ToString); + } + if (content.Contains("DiskName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).DiskName = (string) content.GetValueForProperty("DiskName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).DiskName, global::System.Convert.ToString); + } + if (content.Contains("FileServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).FileServerName = (string) content.GetValueForProperty("FileServerName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).FileServerName, global::System.Convert.ToString); + } + if (content.Contains("ShareName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ShareName = (string) content.GetValueForProperty("ShareName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ShareName, global::System.Convert.ToString); + } + if (content.Contains("JobName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).JobName = (string) content.GetValueForProperty("JobName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).JobName, global::System.Convert.ToString); + } + if (content.Contains("CredentialName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).CredentialName = (string) content.GetValueForProperty("CredentialName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).CredentialName, global::System.Convert.ToString); + } + if (content.Contains("StorageDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).StorageDomainName = (string) content.GetValueForProperty("StorageDomainName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).StorageDomainName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorSimpleIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ManagerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ManagerName = (string) content.GetValueForProperty("ManagerName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ManagerName, global::System.Convert.ToString); + } + if (content.Contains("CertificateName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).CertificateName = (string) content.GetValueForProperty("CertificateName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).CertificateName, global::System.Convert.ToString); + } + if (content.Contains("AccessControlRecordName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).AccessControlRecordName = (string) content.GetValueForProperty("AccessControlRecordName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).AccessControlRecordName, global::System.Convert.ToString); + } + if (content.Contains("DeviceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).DeviceName = (string) content.GetValueForProperty("DeviceName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).DeviceName, global::System.Convert.ToString); + } + if (content.Contains("BackupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).BackupName = (string) content.GetValueForProperty("BackupName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).BackupName, global::System.Convert.ToString); + } + if (content.Contains("ElementName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ElementName = (string) content.GetValueForProperty("ElementName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ElementName, global::System.Convert.ToString); + } + if (content.Contains("ScheduleGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ScheduleGroupName = (string) content.GetValueForProperty("ScheduleGroupName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ScheduleGroupName, global::System.Convert.ToString); + } + if (content.Contains("ChapUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ChapUserName = (string) content.GetValueForProperty("ChapUserName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ChapUserName, global::System.Convert.ToString); + } + if (content.Contains("IscsiServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).IscsiServerName = (string) content.GetValueForProperty("IscsiServerName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).IscsiServerName, global::System.Convert.ToString); + } + if (content.Contains("DiskName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).DiskName = (string) content.GetValueForProperty("DiskName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).DiskName, global::System.Convert.ToString); + } + if (content.Contains("FileServerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).FileServerName = (string) content.GetValueForProperty("FileServerName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).FileServerName, global::System.Convert.ToString); + } + if (content.Contains("ShareName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ShareName = (string) content.GetValueForProperty("ShareName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).ShareName, global::System.Convert.ToString); + } + if (content.Contains("JobName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).JobName = (string) content.GetValueForProperty("JobName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).JobName, global::System.Convert.ToString); + } + if (content.Contains("CredentialName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).CredentialName = (string) content.GetValueForProperty("CredentialName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).CredentialName, global::System.Convert.ToString); + } + if (content.Contains("StorageDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).StorageDomainName = (string) content.GetValueForProperty("StorageDomainName",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).StorageDomainName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(StorSimpleIdentityTypeConverter))] + public partial interface IStorSimpleIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/StorSimpleIdentity.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Models/StorSimpleIdentity.TypeConverter.cs new file mode 100644 index 000000000000..522c779b4f0e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/StorSimpleIdentity.TypeConverter.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorSimpleIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + // we allow string conversion too. + if (type == typeof(global::System.String)) + { + return true; + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + // support direct string to id type conversion. + if (type == typeof(global::System.String)) + { + return new StorSimpleIdentity { Id = sourceValue }; + } + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorSimpleIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorSimpleIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorSimpleIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/StorSimpleIdentity.cs b/swaggerci/storSimple1200Series/generated/api/Models/StorSimpleIdentity.cs new file mode 100644 index 000000000000..271dd757c276 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/StorSimpleIdentity.cs @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + public partial class StorSimpleIdentity : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentityInternal + { + + /// Backing field for property. + private string _accessControlRecordName; + + /// Name of access control record to be fetched. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string AccessControlRecordName { get => this._accessControlRecordName; set => this._accessControlRecordName = value; } + + /// Backing field for property. + private string _backupName; + + /// The backup name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string BackupName { get => this._backupName; set => this._backupName = value; } + + /// Backing field for property. + private string _certificateName; + + /// Certificate Name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string CertificateName { get => this._certificateName; set => this._certificateName = value; } + + /// Backing field for property. + private string _chapUserName; + + /// The user name of chap to be fetched. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ChapUserName { get => this._chapUserName; set => this._chapUserName = value; } + + /// Backing field for property. + private string _credentialName; + + /// The name of storage account credential to be fetched. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string CredentialName { get => this._credentialName; set => this._credentialName = value; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _diskName; + + /// The disk name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string DiskName { get => this._diskName; set => this._diskName = value; } + + /// Backing field for property. + private string _elementName; + + /// The backup element name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ElementName { get => this._elementName; set => this._elementName = value; } + + /// Backing field for property. + private string _fileServerName; + + /// The file server name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string FileServerName { get => this._fileServerName; set => this._fileServerName = value; } + + /// Backing field for property. + private string _id; + + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _iscsiServerName; + + /// The iSCSI server name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string IscsiServerName { get => this._iscsiServerName; set => this._iscsiServerName = value; } + + /// Backing field for property. + private string _jobName; + + /// The job name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string JobName { get => this._jobName; set => this._jobName = value; } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _scheduleGroupName; + + /// The name of the schedule group. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ScheduleGroupName { get => this._scheduleGroupName; set => this._scheduleGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// The file share name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string _storageDomainName; + + /// The storage domain name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string StorageDomainName { get => this._storageDomainName; set => this._storageDomainName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Origin(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Creates an new instance. + public StorSimpleIdentity() + { + + } + } + public partial interface IStorSimpleIdentity : + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable + { + /// Name of access control record to be fetched. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of access control record to be fetched.", + SerializedName = @"accessControlRecordName", + PossibleTypes = new [] { typeof(string) })] + string AccessControlRecordName { get; set; } + /// The backup name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The backup name.", + SerializedName = @"backupName", + PossibleTypes = new [] { typeof(string) })] + string BackupName { get; set; } + /// Certificate Name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Certificate Name", + SerializedName = @"certificateName", + PossibleTypes = new [] { typeof(string) })] + string CertificateName { get; set; } + /// The user name of chap to be fetched. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user name of chap to be fetched.", + SerializedName = @"chapUserName", + PossibleTypes = new [] { typeof(string) })] + string ChapUserName { get; set; } + /// The name of storage account credential to be fetched. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of storage account credential to be fetched.", + SerializedName = @"credentialName", + PossibleTypes = new [] { typeof(string) })] + string CredentialName { get; set; } + /// The device name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + string DeviceName { get; set; } + /// The disk name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The disk name.", + SerializedName = @"diskName", + PossibleTypes = new [] { typeof(string) })] + string DiskName { get; set; } + /// The backup element name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The backup element name.", + SerializedName = @"elementName", + PossibleTypes = new [] { typeof(string) })] + string ElementName { get; set; } + /// The file server name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The file server name.", + SerializedName = @"fileServerName", + PossibleTypes = new [] { typeof(string) })] + string FileServerName { get; set; } + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource identity path", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// The iSCSI server name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The iSCSI server name.", + SerializedName = @"iscsiServerName", + PossibleTypes = new [] { typeof(string) })] + string IscsiServerName { get; set; } + /// The job name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The job name.", + SerializedName = @"jobName", + PossibleTypes = new [] { typeof(string) })] + string JobName { get; set; } + /// The manager name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + string ManagerName { get; set; } + /// The resource group name + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + /// The name of the schedule group. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the schedule group.", + SerializedName = @"scheduleGroupName", + PossibleTypes = new [] { typeof(string) })] + string ScheduleGroupName { get; set; } + /// The file share name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The file share name.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + string ShareName { get; set; } + /// The storage domain name. + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The storage domain name.", + SerializedName = @"storageDomainName", + PossibleTypes = new [] { typeof(string) })] + string StorageDomainName { get; set; } + /// The subscription id + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + + } + internal partial interface IStorSimpleIdentityInternal + + { + /// Name of access control record to be fetched. + string AccessControlRecordName { get; set; } + /// The backup name. + string BackupName { get; set; } + /// Certificate Name + string CertificateName { get; set; } + /// The user name of chap to be fetched. + string ChapUserName { get; set; } + /// The name of storage account credential to be fetched. + string CredentialName { get; set; } + /// The device name. + string DeviceName { get; set; } + /// The disk name. + string DiskName { get; set; } + /// The backup element name. + string ElementName { get; set; } + /// The file server name. + string FileServerName { get; set; } + /// Resource identity path + string Id { get; set; } + /// The iSCSI server name. + string IscsiServerName { get; set; } + /// The job name. + string JobName { get; set; } + /// The manager name + string ManagerName { get; set; } + /// The resource group name + string ResourceGroupName { get; set; } + /// The name of the schedule group. + string ScheduleGroupName { get; set; } + /// The file share name. + string ShareName { get; set; } + /// The storage domain name. + string StorageDomainName { get; set; } + /// The subscription id + string SubscriptionId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Models/StorSimpleIdentity.json.cs b/swaggerci/storSimple1200Series/generated/api/Models/StorSimpleIdentity.json.cs new file mode 100644 index 000000000000..ccdc23b73a60 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Models/StorSimpleIdentity.json.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + public partial class StorSimpleIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new StorSimpleIdentity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject instance to deserialize from. + internal StorSimpleIdentity(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} + {_managerName = If( json?.PropertyT("managerName"), out var __jsonManagerName) ? (string)__jsonManagerName : (string)ManagerName;} + {_certificateName = If( json?.PropertyT("certificateName"), out var __jsonCertificateName) ? (string)__jsonCertificateName : (string)CertificateName;} + {_accessControlRecordName = If( json?.PropertyT("accessControlRecordName"), out var __jsonAccessControlRecordName) ? (string)__jsonAccessControlRecordName : (string)AccessControlRecordName;} + {_deviceName = If( json?.PropertyT("deviceName"), out var __jsonDeviceName) ? (string)__jsonDeviceName : (string)DeviceName;} + {_backupName = If( json?.PropertyT("backupName"), out var __jsonBackupName) ? (string)__jsonBackupName : (string)BackupName;} + {_elementName = If( json?.PropertyT("elementName"), out var __jsonElementName) ? (string)__jsonElementName : (string)ElementName;} + {_scheduleGroupName = If( json?.PropertyT("scheduleGroupName"), out var __jsonScheduleGroupName) ? (string)__jsonScheduleGroupName : (string)ScheduleGroupName;} + {_chapUserName = If( json?.PropertyT("chapUserName"), out var __jsonChapUserName) ? (string)__jsonChapUserName : (string)ChapUserName;} + {_iscsiServerName = If( json?.PropertyT("iscsiServerName"), out var __jsonIscsiServerName) ? (string)__jsonIscsiServerName : (string)IscsiServerName;} + {_diskName = If( json?.PropertyT("diskName"), out var __jsonDiskName) ? (string)__jsonDiskName : (string)DiskName;} + {_fileServerName = If( json?.PropertyT("fileServerName"), out var __jsonFileServerName) ? (string)__jsonFileServerName : (string)FileServerName;} + {_shareName = If( json?.PropertyT("shareName"), out var __jsonShareName) ? (string)__jsonShareName : (string)ShareName;} + {_jobName = If( json?.PropertyT("jobName"), out var __jsonJobName) ? (string)__jsonJobName : (string)JobName;} + {_credentialName = If( json?.PropertyT("credentialName"), out var __jsonCredentialName) ? (string)__jsonCredentialName : (string)CredentialName;} + {_storageDomainName = If( json?.PropertyT("storageDomainName"), out var __jsonStorageDomainName) ? (string)__jsonStorageDomainName : (string)StorageDomainName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); + AddIf( null != (((object)this._managerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._managerName.ToString()) : null, "managerName" ,container.Add ); + AddIf( null != (((object)this._certificateName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._certificateName.ToString()) : null, "certificateName" ,container.Add ); + AddIf( null != (((object)this._accessControlRecordName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._accessControlRecordName.ToString()) : null, "accessControlRecordName" ,container.Add ); + AddIf( null != (((object)this._deviceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._deviceName.ToString()) : null, "deviceName" ,container.Add ); + AddIf( null != (((object)this._backupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._backupName.ToString()) : null, "backupName" ,container.Add ); + AddIf( null != (((object)this._elementName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._elementName.ToString()) : null, "elementName" ,container.Add ); + AddIf( null != (((object)this._scheduleGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._scheduleGroupName.ToString()) : null, "scheduleGroupName" ,container.Add ); + AddIf( null != (((object)this._chapUserName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._chapUserName.ToString()) : null, "chapUserName" ,container.Add ); + AddIf( null != (((object)this._iscsiServerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._iscsiServerName.ToString()) : null, "iscsiServerName" ,container.Add ); + AddIf( null != (((object)this._diskName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._diskName.ToString()) : null, "diskName" ,container.Add ); + AddIf( null != (((object)this._fileServerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._fileServerName.ToString()) : null, "fileServerName" ,container.Add ); + AddIf( null != (((object)this._shareName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._shareName.ToString()) : null, "shareName" ,container.Add ); + AddIf( null != (((object)this._jobName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._jobName.ToString()) : null, "jobName" ,container.Add ); + AddIf( null != (((object)this._credentialName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._credentialName.ToString()) : null, "credentialName" ,container.Add ); + AddIf( null != (((object)this._storageDomainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._storageDomainName.ToString()) : null, "storageDomainName" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/StorSimpleManagementClient.cs b/swaggerci/storSimple1200Series/generated/api/StorSimpleManagementClient.cs new file mode 100644 index 000000000000..35033448a487 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/StorSimpleManagementClient.cs @@ -0,0 +1,20304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + /// + /// Low-level API implementation for the StorSimpleManagementClient service. + /// + public partial class StorSimpleManagementClient + { + + /// Creates or Updates an access control record. + /// The name of the access control record. + /// The subscription id + /// The resource group name + /// The manager name + /// The access control record to be added or updated. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AccessControlRecordsCreateOrUpdate(string accessControlRecordName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/accessControlRecords/" + + global::System.Uri.EscapeDataString(accessControlRecordName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AccessControlRecordsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or Updates an access control record. + /// + /// The access control record to be added or updated. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AccessControlRecordsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/accessControlRecords/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}'"); + } + + // replace URI parameters with values from identity + var accessControlRecordName = _match.Groups["accessControlRecordName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/accessControlRecords/" + + accessControlRecordName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AccessControlRecordsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AccessControlRecordsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecord.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the access control record. + /// The subscription id + /// The resource group name + /// The manager name + /// The access control record to be added or updated. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AccessControlRecordsCreateOrUpdate_Validate(string accessControlRecordName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(accessControlRecordName),accessControlRecordName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the access control record. + /// The name of the access control record to delete. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AccessControlRecordsDelete(string accessControlRecordName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/accessControlRecords/" + + global::System.Uri.EscapeDataString(accessControlRecordName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AccessControlRecordsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the access control record. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AccessControlRecordsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/accessControlRecords/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}'"); + } + + // replace URI parameters with values from identity + var accessControlRecordName = _match.Groups["accessControlRecordName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/accessControlRecords/" + + accessControlRecordName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AccessControlRecordsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AccessControlRecordsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the access control record to delete. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AccessControlRecordsDelete_Validate(string accessControlRecordName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(accessControlRecordName),accessControlRecordName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the properties of the specified access control record name. + /// Name of access control record to be fetched. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AccessControlRecordsGet(string accessControlRecordName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/accessControlRecords/" + + global::System.Uri.EscapeDataString(accessControlRecordName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AccessControlRecordsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the properties of the specified access control record name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AccessControlRecordsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/accessControlRecords/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}'"); + } + + // replace URI parameters with values from identity + var accessControlRecordName = _match.Groups["accessControlRecordName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/accessControlRecords/" + + accessControlRecordName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AccessControlRecordsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AccessControlRecordsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecord.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// Name of access control record to be fetched. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AccessControlRecordsGet_Validate(string accessControlRecordName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(accessControlRecordName),accessControlRecordName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the access control records in a manager. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AccessControlRecordsListByManager(string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/accessControlRecords" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AccessControlRecordsListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the access control records in a manager. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AccessControlRecordsListByManagerViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/accessControlRecords$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/accessControlRecords" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AccessControlRecordsListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AccessControlRecordsListByManager_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecordList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AccessControlRecordsListByManager_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Clear the alerts. + /// The subscription id + /// The resource group name + /// The manager name + /// The clear alert request. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AlertsClear(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/clearAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsClear_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Clear the alerts. + /// + /// The clear alert request. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AlertsClearViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/clearAlerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/clearAlerts'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/clearAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsClear_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AlertsClear_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// The clear alert request. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AlertsClear_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Retrieves all the alerts in a manager. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AlertsListByManager(string subscriptionId, string resourceGroupName, string managerName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/alerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the alerts in a manager. + /// + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AlertsListByManagerViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/alerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/alerts'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/alerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AlertsListByManager_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AlertsListByManager_Validate(string subscriptionId, string resourceGroupName, string managerName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Sends a test alert email. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// The send test alert email request. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AlertsSendTestEmail(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/sendTestAlertEmail" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsSendTestEmail_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Sends a test alert email. + /// + /// The send test alert email request. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AlertsSendTestEmailViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/sendTestAlertEmail$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/sendTestAlertEmail'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/sendTestAlertEmail" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsSendTestEmail_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AlertsSendTestEmail_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// The send test alert email request. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AlertsSendTestEmail_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// List of AvailableProviderOperations + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AvailableProviderOperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.StorSimple/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AvailableProviderOperationsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List of AvailableProviderOperations + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AvailableProviderOperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.StorSimple/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.StorSimple/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.StorSimple/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AvailableProviderOperationsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AvailableProviderOperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AvailableProviderOperations.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AvailableProviderOperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// Creates or Updates the backup schedule Group. + /// The name of the device. + /// The name of the schedule group. + /// The subscription id + /// The resource group name + /// The manager name + /// The schedule group to be created + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupScheduleGroupsCreateOrUpdate(string deviceName, string scheduleGroupName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/backupScheduleGroups/" + + global::System.Uri.EscapeDataString(scheduleGroupName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupScheduleGroupsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or Updates the backup schedule Group. + /// + /// The schedule group to be created + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupScheduleGroupsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/backupScheduleGroups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var scheduleGroupName = _match.Groups["scheduleGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/backupScheduleGroups/" + + scheduleGroupName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupScheduleGroupsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupScheduleGroupsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the device. + /// The name of the schedule group. + /// The subscription id + /// The resource group name + /// The manager name + /// The schedule group to be created + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupScheduleGroupsCreateOrUpdate_Validate(string deviceName, string scheduleGroupName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(scheduleGroupName),scheduleGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the backup schedule group. + /// The name of the device. + /// The name of the schedule group. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupScheduleGroupsDelete(string deviceName, string scheduleGroupName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/backupScheduleGroups/" + + global::System.Uri.EscapeDataString(scheduleGroupName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupScheduleGroupsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the backup schedule group. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupScheduleGroupsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/backupScheduleGroups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var scheduleGroupName = _match.Groups["scheduleGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/backupScheduleGroups/" + + scheduleGroupName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupScheduleGroupsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupScheduleGroupsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the device. + /// The name of the schedule group. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupScheduleGroupsDelete_Validate(string deviceName, string scheduleGroupName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(scheduleGroupName),scheduleGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the properties of the specified backup schedule group name. + /// The name of the device. + /// The name of the schedule group. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupScheduleGroupsGet(string deviceName, string scheduleGroupName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/backupScheduleGroups/" + + global::System.Uri.EscapeDataString(scheduleGroupName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupScheduleGroupsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the properties of the specified backup schedule group name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupScheduleGroupsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/backupScheduleGroups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var scheduleGroupName = _match.Groups["scheduleGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/backupScheduleGroups/" + + scheduleGroupName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupScheduleGroupsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupScheduleGroupsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the device. + /// The name of the schedule group. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupScheduleGroupsGet_Validate(string deviceName, string scheduleGroupName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(scheduleGroupName),scheduleGroupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the backup schedule groups in a device. + /// The name of the device. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupScheduleGroupsListByDevice(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/backupScheduleGroups" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupScheduleGroupsListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the backup schedule groups in a device. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupScheduleGroupsListByDeviceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/backupScheduleGroups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/backupScheduleGroups" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupScheduleGroupsListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupScheduleGroupsListByDevice_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroupList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the device. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupScheduleGroupsListByDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Clones the given backup element to a new disk or share with given details. + /// The device name. + /// The backup name. + /// The backup element name. + /// The subscription id + /// The resource group name + /// The manager name + /// The clone request. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupsClone(string deviceName, string backupName, string elementName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/backups/" + + global::System.Uri.EscapeDataString(backupName) + + "/elements/" + + global::System.Uri.EscapeDataString(elementName) + + "/clone" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupsClone_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Clones the given backup element to a new disk or share with given details. + /// + /// The clone request. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupsCloneViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/backups/(?[^/]+)/elements/(?[^/]+)/clone$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}/elements/{elementName}/clone'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var backupName = _match.Groups["backupName"].Value; + var elementName = _match.Groups["elementName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/backups/" + + backupName + + "/elements/" + + elementName + + "/clone" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupsClone_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupsClone_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The backup name. + /// The backup element name. + /// The subscription id + /// The resource group name + /// The manager name + /// The clone request. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupsClone_Validate(string deviceName, string backupName, string elementName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(backupName),backupName); + await eventListener.AssertNotNull(nameof(elementName),elementName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the backup. + /// The device name. + /// The backup name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupsDelete(string deviceName, string backupName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/backups/" + + global::System.Uri.EscapeDataString(backupName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the backup. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/backups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var backupName = _match.Groups["backupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/backups/" + + backupName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The backup name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupsDelete_Validate(string deviceName, string backupName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(backupName),backupName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// + /// Retrieves all the backups in a device. Can be used to get the backups for failover also. + /// + /// The device name. + /// Set to true if you need backups which can be used for failover. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupsListByDevice(string deviceName, bool? forFailover, string subscriptionId, string resourceGroupName, string managerName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/backups" + + "?" + + (null == forFailover ? global::System.String.Empty : "forFailover=" + global::System.Uri.EscapeDataString(forFailover.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupsListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Retrieves all the backups in a device. Can be used to get the backups for failover also. + /// + /// + /// Set to true if you need backups which can be used for failover. + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupsListByDeviceViaIdentity(global::System.String viaIdentity, bool? forFailover, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/backups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/backups" + + "?" + + (null == forFailover ? global::System.String.Empty : "forFailover=" + global::System.Uri.EscapeDataString(forFailover.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupsListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupsListByDevice_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// Set to true if you need backups which can be used for failover. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupsListByDevice_Validate(string deviceName, bool? forFailover, string subscriptionId, string resourceGroupName, string managerName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Retrieves all the backups in a manager. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupsListByManager(string subscriptionId, string resourceGroupName, string managerName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/backups" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupsListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the backups in a manager. + /// + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BackupsListByManagerViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/backups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/backups'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/backups" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BackupsListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupsListByManager_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BackupsListByManager_Validate(string subscriptionId, string resourceGroupName, string managerName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Creates or updates the chap setting. + /// The device name. + /// The chap user name. + /// The subscription id + /// The resource group name + /// The manager name + /// The chap setting to be added or updated. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChapSettingsCreateOrUpdate(string deviceName, string chapUserName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/chapSettings/" + + global::System.Uri.EscapeDataString(chapUserName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChapSettingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates the chap setting. + /// + /// The chap setting to be added or updated. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChapSettingsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/chapSettings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var chapUserName = _match.Groups["chapUserName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/chapSettings/" + + chapUserName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChapSettingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChapSettingsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The device name. + /// The chap user name. + /// The subscription id + /// The resource group name + /// The manager name + /// The chap setting to be added or updated. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChapSettingsCreateOrUpdate_Validate(string deviceName, string chapUserName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(chapUserName),chapUserName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the chap setting. + /// The device name. + /// The chap user name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChapSettingsDelete(string deviceName, string chapUserName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/chapSettings/" + + global::System.Uri.EscapeDataString(chapUserName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChapSettingsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the chap setting. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChapSettingsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/chapSettings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var chapUserName = _match.Groups["chapUserName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/chapSettings/" + + chapUserName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChapSettingsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChapSettingsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The chap user name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChapSettingsDelete_Validate(string deviceName, string chapUserName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(chapUserName),chapUserName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the properties of the specified chap setting name. + /// The device name. + /// The user name of chap to be fetched. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChapSettingsGet(string deviceName, string chapUserName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/chapSettings/" + + global::System.Uri.EscapeDataString(chapUserName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChapSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the properties of the specified chap setting name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChapSettingsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/chapSettings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var chapUserName = _match.Groups["chapUserName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/chapSettings/" + + chapUserName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChapSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChapSettingsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The user name of chap to be fetched. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChapSettingsGet_Validate(string deviceName, string chapUserName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(chapUserName),chapUserName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the chap settings in a device. + /// The name of the device. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChapSettingsListByDevice(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/chapSettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChapSettingsListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the chap settings in a device. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ChapSettingsListByDeviceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/chapSettings$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/chapSettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ChapSettingsListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChapSettingsListByDevice_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapSettingsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the device. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ChapSettingsListByDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Creates or updates the alert settings + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// The alert settings. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesCreateOrUpdateAlertSettings(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/alertSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesCreateOrUpdateAlertSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates the alert settings + /// + /// The alert settings. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesCreateOrUpdateAlertSettingsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/alertSettings/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/alertSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesCreateOrUpdateAlertSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesCreateOrUpdateAlertSettings_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// The alert settings. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesCreateOrUpdateAlertSettings_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates the security settings. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// The security settings. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesCreateOrUpdateSecuritySettings(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/securitySettings/default/update" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesCreateOrUpdateSecuritySettings_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Creates or updates the security settings. + /// + /// The security settings. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesCreateOrUpdateSecuritySettingsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/securitySettings/default/update$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/securitySettings/default/update'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/securitySettings/default/update" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesCreateOrUpdateSecuritySettings_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesCreateOrUpdateSecuritySettings_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// The security settings. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesCreateOrUpdateSecuritySettings_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deactivates the device. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesDeactivate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/deactivate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesDeactivate_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deactivates the device. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesDeactivateViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/deactivate$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/deactivate'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/deactivate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesDeactivate_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesDeactivate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesDeactivate_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Deletes the device. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesDelete(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the device. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesDelete_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Downloads updates on the device. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesDownloadUpdates(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/download" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesDownloadUpdates_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Downloads updates on the device. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesDownloadUpdatesViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/download$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/download'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/download" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesDownloadUpdates_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesDownloadUpdates_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesDownloadUpdates_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Fails over the device to another device. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// The failover request. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesFailover(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequest body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/failover" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesFailover_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Fails over the device to another device. + /// + /// The failover request. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesFailoverViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequest body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/failover$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/failover'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/failover" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesFailover_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesFailover_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// The failover request. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesFailover_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFailoverRequest body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Returns the properties of the specified device name. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// Specify $expand=details to populate additional fields related to the device. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesGet(string deviceName, string subscriptionId, string resourceGroupName, string managerName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the alert settings of the specified device name. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesGetAlertSettings(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/alertSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGetAlertSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the alert settings of the specified device name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesGetAlertSettingsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/alertSettings/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/alertSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGetAlertSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesGetAlertSettings_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesGetAlertSettings_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the network settings of the specified device name. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesGetNetworkSettings(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/networkSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGetNetworkSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the network settings of the specified device name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesGetNetworkSettingsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/networkSettings/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/networkSettings/default'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/networkSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGetNetworkSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesGetNetworkSettings_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.NetworkSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesGetNetworkSettings_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the time settings of the specified device name. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesGetTimeSettings(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/timeSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGetTimeSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the time settings of the specified device name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesGetTimeSettingsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/timeSettings/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/timeSettings/default'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/timeSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGetTimeSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesGetTimeSettings_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.TimeSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesGetTimeSettings_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the update summary of the specified device name. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesGetUpdateSummary(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/updateSummary/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGetUpdateSummary_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the update summary of the specified device name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesGetUpdateSummaryViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/updateSummary/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/updateSummary/default'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/updateSummary/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGetUpdateSummary_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesGetUpdateSummary_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Updates.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesGetUpdateSummary_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the properties of the specified device name. + /// + /// Specify $expand=details to populate additional fields related to the device. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesGetViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Device.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// Specify $expand=details to populate additional fields related to the device. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesGet_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Expand),Expand); + } + } + + /// Installs the updates on the device. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesInstallUpdates(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/install" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesInstallUpdates_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Installs the updates on the device. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesInstallUpdatesViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/install$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/install'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/install" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesInstallUpdates_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesInstallUpdates_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesInstallUpdates_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the devices in a manager. + /// The subscription id + /// The resource group name + /// The manager name + /// Specify $expand=details to populate additional fields related to the device. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesListByManager(string subscriptionId, string resourceGroupName, string managerName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the devices in a manager. + /// + /// Specify $expand=details to populate additional fields related to the device. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesListByManagerViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesListByManager_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// Specify $expand=details to populate additional fields related to the device. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesListByManager_Validate(string subscriptionId, string resourceGroupName, string managerName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Expand),Expand); + } + } + + /// + /// Retrieves all the devices which can be used as failover targets for the given device. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// Specify $expand=details to populate additional fields related to the device. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesListFailoverTarget(string deviceName, string subscriptionId, string resourceGroupName, string managerName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/failoverTargets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesListFailoverTarget_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Retrieves all the devices which can be used as failover targets for the given device. + /// + /// + /// Specify $expand=details to populate additional fields related to the device. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesListFailoverTargetViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/failoverTargets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/failoverTargets'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/failoverTargets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesListFailoverTarget_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesListFailoverTarget_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DeviceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// Specify $expand=details to populate additional fields related to the device. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesListFailoverTarget_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Expand),Expand); + } + } + + /// Retrieves metric definition of all metrics aggregated at device. + /// The name of the appliance. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesListMetricDefinition(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/metricsDefinitions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesListMetricDefinition_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves metric definition of all metrics aggregated at device. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesListMetricDefinitionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/metricsDefinitions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metricsDefinitions'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/metricsDefinitions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesListMetricDefinition_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesListMetricDefinition_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDefinitionList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the appliance. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesListMetricDefinition_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves the device metrics. + /// The name of the appliance. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesListMetrics(string deviceName, string subscriptionId, string resourceGroupName, string managerName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/metrics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesListMetrics_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves the device metrics. + /// + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesListMetricsViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/metrics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metrics'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/metrics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesListMetrics_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesListMetrics_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the appliance. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesListMetrics_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Patches the device. + /// The device Name. + /// The subscription id + /// The resource group name + /// The manager name + /// Patch representation of the device. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesPatch(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesPatch_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Patches the device. + /// + /// Patch representation of the device. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesPatchViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesPatch_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesPatch_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Device.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device Name. + /// The subscription id + /// The resource group name + /// The manager name + /// Patch representation of the device. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesPatch_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Scans for updates on the device. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesScanForUpdates(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/scanForUpdates" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesScanForUpdates_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Scans for updates on the device. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DevicesScanForUpdatesViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/scanForUpdates$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/scanForUpdates'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/scanForUpdates" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DevicesScanForUpdates_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesScanForUpdates_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DevicesScanForUpdates_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Backup the file server now. + /// The device name. + /// The file server name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersBackupNow(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/fileservers/" + + global::System.Uri.EscapeDataString(fileServerName) + + "/backup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersBackupNow_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Backup the file server now. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersBackupNowViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/fileservers/(?[^/]+)/backup$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/backup'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var fileServerName = _match.Groups["fileServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/fileservers/" + + fileServerName + + "/backup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersBackupNow_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersBackupNow_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The file server name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersBackupNow_Validate(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(fileServerName),fileServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Creates or updates the file server. + /// The device name. + /// The file server name. + /// The subscription id + /// The resource group name + /// The manager name + /// The file server. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersCreateOrUpdate(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/fileservers/" + + global::System.Uri.EscapeDataString(fileServerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates the file server. + /// + /// The file server. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/fileservers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var fileServerName = _match.Groups["fileServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/fileservers/" + + fileServerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServer.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The device name. + /// The file server name. + /// The subscription id + /// The resource group name + /// The manager name + /// The file server. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersCreateOrUpdate_Validate(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(fileServerName),fileServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the file server. + /// The device name. + /// The file server name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersDelete(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/fileservers/" + + global::System.Uri.EscapeDataString(fileServerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the file server. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/fileservers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var fileServerName = _match.Groups["fileServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/fileservers/" + + fileServerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The file server name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersDelete_Validate(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(fileServerName),fileServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the properties of the specified file server name. + /// The device name. + /// The file server name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersGet(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/fileservers/" + + global::System.Uri.EscapeDataString(fileServerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the properties of the specified file server name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/fileservers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var fileServerName = _match.Groups["fileServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/fileservers/" + + fileServerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServer.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The file server name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersGet_Validate(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(fileServerName),fileServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the file servers in a device. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersListByDevice(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/fileservers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the file servers in a device. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersListByDeviceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/fileservers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/fileservers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersListByDevice_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersListByDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the file servers in a manager. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersListByManager(string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/fileservers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the file servers in a manager. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersListByManagerViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/fileservers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/fileservers'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/fileservers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersListByManager_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersListByManager_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves metric definitions of all metrics aggregated at the file server. + /// The name of the device. + /// The name of the file server. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersListMetricDefinition(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/fileservers/" + + global::System.Uri.EscapeDataString(fileServerName) + + "/metricsDefinitions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersListMetricDefinition_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves metric definitions of all metrics aggregated at the file server. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersListMetricDefinitionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/fileservers/(?[^/]+)/metricsDefinitions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/metricsDefinitions'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var fileServerName = _match.Groups["fileServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/fileservers/" + + fileServerName + + "/metricsDefinitions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersListMetricDefinition_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersListMetricDefinition_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDefinitionList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the device. + /// The name of the file server. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersListMetricDefinition_Validate(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(fileServerName),fileServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Gets the file server metrics. + /// The name of the device. + /// The name of the file server name. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersListMetrics(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/fileservers/" + + global::System.Uri.EscapeDataString(fileServerName) + + "/metrics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersListMetrics_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the file server metrics. + /// + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServersListMetricsViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/fileservers/(?[^/]+)/metrics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/metrics'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var fileServerName = _match.Groups["fileServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/fileservers/" + + fileServerName + + "/metrics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServersListMetrics_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersListMetrics_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the device. + /// The name of the file server name. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServersListMetrics_Validate(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(fileServerName),fileServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Creates or updates the file share. + /// The device name. + /// The file server name. + /// The file share name. + /// The subscription id + /// The resource group name + /// The manager name + /// The file share. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesCreateOrUpdate(string deviceName, string fileServerName, string shareName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/fileservers/" + + global::System.Uri.EscapeDataString(fileServerName) + + "/shares/" + + global::System.Uri.EscapeDataString(shareName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates the file share. + /// + /// The file share. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/fileservers/(?[^/]+)/shares/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var fileServerName = _match.Groups["fileServerName"].Value; + var shareName = _match.Groups["shareName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/fileservers/" + + fileServerName + + "/shares/" + + shareName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShare.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The device name. + /// The file server name. + /// The file share name. + /// The subscription id + /// The resource group name + /// The manager name + /// The file share. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesCreateOrUpdate_Validate(string deviceName, string fileServerName, string shareName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(fileServerName),fileServerName); + await eventListener.AssertNotNull(nameof(shareName),shareName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the file share. + /// The device name. + /// The file server name. + /// The file share Name + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesDelete(string deviceName, string fileServerName, string shareName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/fileservers/" + + global::System.Uri.EscapeDataString(fileServerName) + + "/shares/" + + global::System.Uri.EscapeDataString(shareName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the file share. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/fileservers/(?[^/]+)/shares/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var fileServerName = _match.Groups["fileServerName"].Value; + var shareName = _match.Groups["shareName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/fileservers/" + + fileServerName + + "/shares/" + + shareName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The file server name. + /// The file share Name + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesDelete_Validate(string deviceName, string fileServerName, string shareName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(fileServerName),fileServerName); + await eventListener.AssertNotNull(nameof(shareName),shareName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the properties of the specified file share name. + /// The device name. + /// The file server name. + /// The file share name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesGet(string deviceName, string fileServerName, string shareName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/fileservers/" + + global::System.Uri.EscapeDataString(fileServerName) + + "/shares/" + + global::System.Uri.EscapeDataString(shareName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the properties of the specified file share name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/fileservers/(?[^/]+)/shares/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var fileServerName = _match.Groups["fileServerName"].Value; + var shareName = _match.Groups["shareName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/fileservers/" + + fileServerName + + "/shares/" + + shareName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShare.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The file server name. + /// The file share name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesGet_Validate(string deviceName, string fileServerName, string shareName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(fileServerName),fileServerName); + await eventListener.AssertNotNull(nameof(shareName),shareName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the file shares in a device. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesListByDevice(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/shares" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the file shares in a device. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesListByDeviceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/shares$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/shares'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/shares" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesListByDevice_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShareList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesListByDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the file shares in a file server. + /// The device name. + /// The file server name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesListByFileServer(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/fileservers/" + + global::System.Uri.EscapeDataString(fileServerName) + + "/shares" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesListByFileServer_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the file shares in a file server. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesListByFileServerViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/fileservers/(?[^/]+)/shares$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var fileServerName = _match.Groups["fileServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/fileservers/" + + fileServerName + + "/shares" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesListByFileServer_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesListByFileServer_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShareList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The device name. + /// The file server name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesListByFileServer_Validate(string deviceName, string fileServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(fileServerName),fileServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves metric definitions of all metrics aggregated at the file share. + /// The device name. + /// The file server name. + /// The file share name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesListMetricDefinition(string deviceName, string fileServerName, string shareName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/fileservers/" + + global::System.Uri.EscapeDataString(fileServerName) + + "/shares/" + + global::System.Uri.EscapeDataString(shareName) + + "/metricsDefinitions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesListMetricDefinition_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves metric definitions of all metrics aggregated at the file share. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesListMetricDefinitionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/fileservers/(?[^/]+)/shares/(?[^/]+)/metricsDefinitions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}/metricsDefinitions'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var fileServerName = _match.Groups["fileServerName"].Value; + var shareName = _match.Groups["shareName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/fileservers/" + + fileServerName + + "/shares/" + + shareName + + "/metricsDefinitions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesListMetricDefinition_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesListMetricDefinition_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDefinitionList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The device name. + /// The file server name. + /// The file share name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesListMetricDefinition_Validate(string deviceName, string fileServerName, string shareName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(fileServerName),fileServerName); + await eventListener.AssertNotNull(nameof(shareName),shareName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Gets the file share metrics + /// The device name. + /// The file server name. + /// The file share name. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesListMetrics(string deviceName, string fileServerName, string shareName, string subscriptionId, string resourceGroupName, string managerName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/fileservers/" + + global::System.Uri.EscapeDataString(fileServerName) + + "/shares/" + + global::System.Uri.EscapeDataString(shareName) + + "/metrics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesListMetrics_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the file share metrics + /// + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesListMetricsViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/fileservers/(?[^/]+)/shares/(?[^/]+)/metrics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}/metrics'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var fileServerName = _match.Groups["fileServerName"].Value; + var shareName = _match.Groups["shareName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/fileservers/" + + fileServerName + + "/shares/" + + shareName + + "/metrics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesListMetrics_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesListMetrics_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The file server name. + /// The file share name. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesListMetrics_Validate(string deviceName, string fileServerName, string shareName, string subscriptionId, string resourceGroupName, string managerName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(fileServerName),fileServerName); + await eventListener.AssertNotNull(nameof(shareName),shareName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Creates or updates the iSCSI disk. + /// The device name. + /// The iSCSI server name. + /// The disk name. + /// The subscription id + /// The resource group name + /// The manager name + /// The iSCSI disk. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksCreateOrUpdate(string deviceName, string iscsiServerName, string diskName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/iscsiservers/" + + global::System.Uri.EscapeDataString(iscsiServerName) + + "/disks/" + + global::System.Uri.EscapeDataString(diskName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates the iSCSI disk. + /// + /// The iSCSI disk. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/iscsiservers/(?[^/]+)/disks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var iscsiServerName = _match.Groups["iscsiServerName"].Value; + var diskName = _match.Groups["diskName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/iscsiservers/" + + iscsiServerName + + "/disks/" + + diskName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDisk.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The device name. + /// The iSCSI server name. + /// The disk name. + /// The subscription id + /// The resource group name + /// The manager name + /// The iSCSI disk. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksCreateOrUpdate_Validate(string deviceName, string iscsiServerName, string diskName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(iscsiServerName),iscsiServerName); + await eventListener.AssertNotNull(nameof(diskName),diskName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the iSCSI disk. + /// The device name. + /// The iSCSI server name. + /// The disk name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksDelete(string deviceName, string iscsiServerName, string diskName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/iscsiservers/" + + global::System.Uri.EscapeDataString(iscsiServerName) + + "/disks/" + + global::System.Uri.EscapeDataString(diskName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the iSCSI disk. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/iscsiservers/(?[^/]+)/disks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var iscsiServerName = _match.Groups["iscsiServerName"].Value; + var diskName = _match.Groups["diskName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/iscsiservers/" + + iscsiServerName + + "/disks/" + + diskName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The iSCSI server name. + /// The disk name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksDelete_Validate(string deviceName, string iscsiServerName, string diskName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(iscsiServerName),iscsiServerName); + await eventListener.AssertNotNull(nameof(diskName),diskName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the properties of the specified iSCSI disk name. + /// The device name. + /// The iSCSI server name. + /// The disk name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksGet(string deviceName, string iscsiServerName, string diskName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/iscsiservers/" + + global::System.Uri.EscapeDataString(iscsiServerName) + + "/disks/" + + global::System.Uri.EscapeDataString(diskName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the properties of the specified iSCSI disk name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/iscsiservers/(?[^/]+)/disks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var iscsiServerName = _match.Groups["iscsiServerName"].Value; + var diskName = _match.Groups["diskName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/iscsiservers/" + + iscsiServerName + + "/disks/" + + diskName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDisk.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The iSCSI server name. + /// The disk name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksGet_Validate(string deviceName, string iscsiServerName, string diskName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(iscsiServerName),iscsiServerName); + await eventListener.AssertNotNull(nameof(diskName),diskName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the iSCSI disks in a device. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksListByDevice(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/disks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the iSCSI disks in a device. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksListByDeviceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/disks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/disks'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/disks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksListByDevice_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksListByDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the disks in a iSCSI server. + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksListByIscsiServer(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/iscsiservers/" + + global::System.Uri.EscapeDataString(iscsiServerName) + + "/disks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksListByIscsiServer_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the disks in a iSCSI server. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksListByIscsiServerViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/iscsiservers/(?[^/]+)/disks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var iscsiServerName = _match.Groups["iscsiServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/iscsiservers/" + + iscsiServerName + + "/disks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksListByIscsiServer_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksListByIscsiServer_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDiskList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksListByIscsiServer_Validate(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(iscsiServerName),iscsiServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves metric definitions for all metric aggregated at the iSCSI disk. + /// The device name. + /// The iSCSI server name. + /// The iSCSI disk name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksListMetricDefinition(string deviceName, string iscsiServerName, string diskName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/iscsiservers/" + + global::System.Uri.EscapeDataString(iscsiServerName) + + "/disks/" + + global::System.Uri.EscapeDataString(diskName) + + "/metricsDefinitions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksListMetricDefinition_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves metric definitions for all metric aggregated at the iSCSI disk. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksListMetricDefinitionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/iscsiservers/(?[^/]+)/disks/(?[^/]+)/metricsDefinitions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}/metricsDefinitions'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var iscsiServerName = _match.Groups["iscsiServerName"].Value; + var diskName = _match.Groups["diskName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/iscsiservers/" + + iscsiServerName + + "/disks/" + + diskName + + "/metricsDefinitions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksListMetricDefinition_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksListMetricDefinition_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDefinitionList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The device name. + /// The iSCSI server name. + /// The iSCSI disk name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksListMetricDefinition_Validate(string deviceName, string iscsiServerName, string diskName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(iscsiServerName),iscsiServerName); + await eventListener.AssertNotNull(nameof(diskName),diskName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Gets the iSCSI disk metrics + /// The device name. + /// The iSCSI server name. + /// The iSCSI disk name. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksListMetrics(string deviceName, string iscsiServerName, string diskName, string subscriptionId, string resourceGroupName, string managerName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/iscsiservers/" + + global::System.Uri.EscapeDataString(iscsiServerName) + + "/disks/" + + global::System.Uri.EscapeDataString(diskName) + + "/metrics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksListMetrics_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the iSCSI disk metrics + /// + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiDisksListMetricsViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/iscsiservers/(?[^/]+)/disks/(?[^/]+)/metrics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}/metrics'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var iscsiServerName = _match.Groups["iscsiServerName"].Value; + var diskName = _match.Groups["diskName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/iscsiservers/" + + iscsiServerName + + "/disks/" + + diskName + + "/metrics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiDisksListMetrics_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksListMetrics_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The iSCSI server name. + /// The iSCSI disk name. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiDisksListMetrics_Validate(string deviceName, string iscsiServerName, string diskName, string subscriptionId, string resourceGroupName, string managerName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(iscsiServerName),iscsiServerName); + await eventListener.AssertNotNull(nameof(diskName),diskName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Backup the iSCSI server now. + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersBackupNow(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/iscsiservers/" + + global::System.Uri.EscapeDataString(iscsiServerName) + + "/backup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersBackupNow_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Backup the iSCSI server now. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersBackupNowViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/iscsiservers/(?[^/]+)/backup$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/backup'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var iscsiServerName = _match.Groups["iscsiServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/iscsiservers/" + + iscsiServerName + + "/backup" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersBackupNow_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersBackupNow_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersBackupNow_Validate(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(iscsiServerName),iscsiServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Creates or updates the iSCSI server. + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// The iSCSI server. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersCreateOrUpdate(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/iscsiservers/" + + global::System.Uri.EscapeDataString(iscsiServerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates the iSCSI server. + /// + /// The iSCSI server. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/iscsiservers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var iscsiServerName = _match.Groups["iscsiServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/iscsiservers/" + + iscsiServerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServer.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// The iSCSI server. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersCreateOrUpdate_Validate(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(iscsiServerName),iscsiServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the iSCSI server. + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersDelete(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/iscsiservers/" + + global::System.Uri.EscapeDataString(iscsiServerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the iSCSI server. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/iscsiservers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var iscsiServerName = _match.Groups["iscsiServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/iscsiservers/" + + iscsiServerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersDelete_Validate(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(iscsiServerName),iscsiServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the properties of the specified iSCSI server name. + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersGet(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/iscsiservers/" + + global::System.Uri.EscapeDataString(iscsiServerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the properties of the specified iSCSI server name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/iscsiservers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var iscsiServerName = _match.Groups["iscsiServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/iscsiservers/" + + iscsiServerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServer.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersGet_Validate(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(iscsiServerName),iscsiServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the iSCSI in a device. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersListByDevice(string deviceName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/iscsiservers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the iSCSI in a device. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersListByDeviceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/iscsiservers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/iscsiservers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersListByDevice_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersListByDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the iSCSI servers in a manager. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersListByManager(string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/iscsiservers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the iSCSI servers in a manager. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersListByManagerViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/iscsiservers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/iscsiservers'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/iscsiservers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersListByManager_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersListByManager_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves metric definitions for all metrics aggregated at iSCSI server. + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersListMetricDefinition(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/iscsiservers/" + + global::System.Uri.EscapeDataString(iscsiServerName) + + "/metricsDefinitions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersListMetricDefinition_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves metric definitions for all metrics aggregated at iSCSI server. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersListMetricDefinitionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/iscsiservers/(?[^/]+)/metricsDefinitions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/metricsDefinitions'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var iscsiServerName = _match.Groups["iscsiServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/iscsiservers/" + + iscsiServerName + + "/metricsDefinitions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersListMetricDefinition_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersListMetricDefinition_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDefinitionList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersListMetricDefinition_Validate(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(iscsiServerName),iscsiServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Gets the iSCSI server metrics + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersListMetrics(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/iscsiservers/" + + global::System.Uri.EscapeDataString(iscsiServerName) + + "/metrics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersListMetrics_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the iSCSI server metrics + /// + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task IscsiServersListMetricsViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/iscsiservers/(?[^/]+)/metrics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/metrics'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var iscsiServerName = _match.Groups["iscsiServerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/iscsiservers/" + + iscsiServerName + + "/metrics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.IscsiServersListMetrics_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersListMetrics_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The device name. + /// The iSCSI server name. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task IscsiServersListMetrics_Validate(string deviceName, string iscsiServerName, string subscriptionId, string resourceGroupName, string managerName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(iscsiServerName),iscsiServerName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Returns the properties of the specified job name. + /// The device name. + /// The job name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsGet(string deviceName, string jobName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/jobs/" + + global::System.Uri.EscapeDataString(jobName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the properties of the specified job name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/jobs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs/{jobName}'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var jobName = _match.Groups["jobName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/jobs/" + + jobName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Job.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The device name. + /// The job name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsGet_Validate(string deviceName, string jobName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(jobName),jobName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the jobs in a device. + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsListByDevice(string deviceName, string subscriptionId, string resourceGroupName, string managerName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/devices/" + + global::System.Uri.EscapeDataString(deviceName) + + "/jobs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the jobs in a device. + /// + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsListByDeviceViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/devices/(?[^/]+)/jobs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs'"); + } + + // replace URI parameters with values from identity + var deviceName = _match.Groups["deviceName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/devices/" + + deviceName + + "/jobs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsListByDevice_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsListByDevice_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The device name. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsListByDevice_Validate(string deviceName, string subscriptionId, string resourceGroupName, string managerName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deviceName),deviceName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Retrieves all the jobs in a manager. + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsListByManager(string subscriptionId, string resourceGroupName, string managerName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/jobs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the jobs in a manager. + /// + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsListByManagerViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/jobs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/jobs'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/jobs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsListByManager_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.JobList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsListByManager_Validate(string subscriptionId, string resourceGroupName, string managerName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Creates the extended info of the manager. + /// The subscription id + /// The resource group name + /// The manager name + /// The manager extended information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersCreateExtendedInfo(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/extendedInformation/vaultExtendedInfo" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersCreateExtendedInfo_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates the extended info of the manager. + /// + /// The manager extended information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersCreateExtendedInfoViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/extendedInformation/vaultExtendedInfo$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/extendedInformation/vaultExtendedInfo" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersCreateExtendedInfo_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersCreateExtendedInfo_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// The manager extended information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersCreateExtendedInfo_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates the manager. + /// The subscription id + /// The resource group name + /// The manager name + /// The manager. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersCreateOrUpdate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates the manager. + /// + /// The manager. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Manager.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Manager.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// The manager. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the manager. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersDelete(string subscriptionId, string resourceGroupName, string managerName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the extended info of the manager. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersDeleteExtendedInfo(string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/extendedInformation/vaultExtendedInfo" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersDeleteExtendedInfo_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the extended info of the manager. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersDeleteExtendedInfoViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/extendedInformation/vaultExtendedInfo$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/extendedInformation/vaultExtendedInfo" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersDeleteExtendedInfo_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersDeleteExtendedInfo_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersDeleteExtendedInfo_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Deletes the manager. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersDelete_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the properties of the specified manager name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersGet(string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the symmetric encryption key of the manager. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersGetEncryptionKey(string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/getEncryptionKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersGetEncryptionKey_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the symmetric encryption key of the manager. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersGetEncryptionKeyViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/getEncryptionKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/getEncryptionKey'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/getEncryptionKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersGetEncryptionKey_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersGetEncryptionKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SymmetricEncryptedSecret.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersGetEncryptionKey_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the encryption settings of the manager. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersGetEncryptionSettings(string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/encryptionSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersGetEncryptionSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the encryption settings of the manager. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersGetEncryptionSettingsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/encryptionSettings/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/encryptionSettings/default'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/encryptionSettings/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersGetEncryptionSettings_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersGetEncryptionSettings_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.EncryptionSettings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersGetEncryptionSettings_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the extended information of the specified manager name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersGetExtendedInfo(string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/extendedInformation/vaultExtendedInfo" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersGetExtendedInfo_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the extended information of the specified manager name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersGetExtendedInfoViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/extendedInformation/vaultExtendedInfo$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/extendedInformation/vaultExtendedInfo" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersGetExtendedInfo_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersGetExtendedInfo_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersGetExtendedInfo_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the properties of the specified manager name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Manager.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersGet_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the managers in a subscription. + /// The subscription id + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.StorSimple/managers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the managers in a resource group. + /// The subscription id + /// The resource group name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersListByResourceGroup(string subscriptionId, string resourceGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the managers in a resource group. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The subscription id + /// The resource group name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + } + } + + /// Retrieves metric definition of all metrics aggregated at manager. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersListMetricDefinition(string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/metricsDefinitions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersListMetricDefinition_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves metric definition of all metrics aggregated at manager. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersListMetricDefinitionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/metricsDefinitions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/metricsDefinitions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/metricsDefinitions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersListMetricDefinition_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersListMetricDefinition_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricDefinitionList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersListMetricDefinition_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Gets the manager metrics + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersListMetrics(string subscriptionId, string resourceGroupName, string managerName, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/metrics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersListMetrics_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the manager metrics + /// + /// OData Filter options + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersListMetricsViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/metrics$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/metrics'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/metrics" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersListMetrics_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersListMetrics_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.MetricList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// OData Filter options + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersListMetrics_Validate(string subscriptionId, string resourceGroupName, string managerName, string Filter, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Retrieves all the managers in a subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.StorSimple/managers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.StorSimple/managers'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.StorSimple/managers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription id + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// Updates the StorSimple Manager. + /// The subscription id + /// The resource group name + /// The manager name + /// The manager update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersUpdate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the extended info of the manager. + /// The subscription id + /// The resource group name + /// The manager name + /// Pass the ETag of ExtendedInfo fetched from GET call + /// The manager extended information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersUpdateExtendedInfo(string subscriptionId, string resourceGroupName, string managerName, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/extendedInformation/vaultExtendedInfo" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersUpdateExtendedInfo_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates the extended info of the manager. + /// + /// Pass the ETag of ExtendedInfo fetched from GET call + /// The manager extended information. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersUpdateExtendedInfoViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/extendedInformation/vaultExtendedInfo$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/extendedInformation/vaultExtendedInfo" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersUpdateExtendedInfo_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersUpdateExtendedInfo_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfo.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// Pass the ETag of ExtendedInfo fetched from GET call + /// The manager extended information. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersUpdateExtendedInfo_Validate(string subscriptionId, string resourceGroupName, string managerName, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Updates the StorSimple Manager. + /// + /// The manager update parameters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Manager.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// The manager update parameters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersUpdate_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Upload Vault Cred Certificate. + /// Returns UploadCertificateResponse + /// + /// Certificate Name + /// The subscription id + /// The resource group name + /// The manager name + /// UploadCertificateRequest Request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersUploadRegistrationCertificate(string certificateName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/certificates/" + + global::System.Uri.EscapeDataString(certificateName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersUploadRegistrationCertificate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Upload Vault Cred Certificate. + /// Returns UploadCertificateResponse + /// + /// + /// UploadCertificateRequest Request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagersUploadRegistrationCertificateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/certificates/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/certificates/{certificateName}'"); + } + + // replace URI parameters with values from identity + var certificateName = _match.Groups["certificateName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/certificates/" + + certificateName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagersUploadRegistrationCertificate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersUploadRegistrationCertificate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UploadCertificateResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// Certificate Name + /// The subscription id + /// The resource group name + /// The manager name + /// UploadCertificateRequest Request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagersUploadRegistrationCertificate_Validate(string certificateName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(certificateName),certificateName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates the storage account credential + /// The credential name. + /// The subscription id + /// The resource group name + /// The manager name + /// The storage account credential to be added or updated. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountCredentialsCreateOrUpdate(string credentialName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/storageAccountCredentials/" + + global::System.Uri.EscapeDataString(credentialName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountCredentialsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates the storage account credential + /// + /// The storage account credential to be added or updated. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountCredentialsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/storageAccountCredentials/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}'"); + } + + // replace URI parameters with values from identity + var credentialName = _match.Groups["credentialName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/storageAccountCredentials/" + + credentialName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountCredentialsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountCredentialsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The credential name. + /// The subscription id + /// The resource group name + /// The manager name + /// The storage account credential to be added or updated. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountCredentialsCreateOrUpdate_Validate(string credentialName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(credentialName),credentialName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the storage account credential + /// The name of the storage account credential. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountCredentialsDelete(string credentialName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/storageAccountCredentials/" + + global::System.Uri.EscapeDataString(credentialName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountCredentialsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the storage account credential + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountCredentialsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/storageAccountCredentials/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}'"); + } + + // replace URI parameters with values from identity + var credentialName = _match.Groups["credentialName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/storageAccountCredentials/" + + credentialName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountCredentialsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountCredentialsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the storage account credential. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountCredentialsDelete_Validate(string credentialName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(credentialName),credentialName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the properties of the specified storage account credential name. + /// The name of storage account credential to be fetched. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountCredentialsGet(string credentialName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/storageAccountCredentials/" + + global::System.Uri.EscapeDataString(credentialName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountCredentialsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the properties of the specified storage account credential name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountCredentialsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/storageAccountCredentials/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}'"); + } + + // replace URI parameters with values from identity + var credentialName = _match.Groups["credentialName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/storageAccountCredentials/" + + credentialName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountCredentialsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountCredentialsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of storage account credential to be fetched. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountCredentialsGet_Validate(string credentialName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(credentialName),credentialName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the storage account credentials in a manager. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountCredentialsListByManager(string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/storageAccountCredentials" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountCredentialsListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the storage account credentials in a manager. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountCredentialsListByManagerViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/storageAccountCredentials$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/storageAccountCredentials" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountCredentialsListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountCredentialsListByManager_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredentialList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountCredentialsListByManager_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Creates or updates the storage domain. + /// The storage domain name. + /// The subscription id + /// The resource group name + /// The manager name + /// The storageDomain. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageDomainsCreateOrUpdate(string storageDomainName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/storageDomains/" + + global::System.Uri.EscapeDataString(storageDomainName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageDomainsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates the storage domain. + /// + /// The storageDomain. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageDomainsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/storageDomains/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}'"); + } + + // replace URI parameters with values from identity + var storageDomainName = _match.Groups["storageDomainName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/storageDomains/" + + storageDomainName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageDomainsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageDomainsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomain.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The storage domain name. + /// The subscription id + /// The resource group name + /// The manager name + /// The storageDomain. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageDomainsCreateOrUpdate_Validate(string storageDomainName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain body, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(storageDomainName),storageDomainName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the storage domain. + /// The storage domain name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageDomainsDelete(string storageDomainName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/storageDomains/" + + global::System.Uri.EscapeDataString(storageDomainName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageDomainsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the storage domain. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageDomainsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/storageDomains/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}'"); + } + + // replace URI parameters with values from identity + var storageDomainName = _match.Groups["storageDomainName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/storageDomains/" + + storageDomainName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageDomainsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageDomainsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The storage domain name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageDomainsDelete_Validate(string storageDomainName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(storageDomainName),storageDomainName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Returns the properties of the specified storage domain name. + /// The storage domain name. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageDomainsGet(string storageDomainName, string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/storageDomains/" + + global::System.Uri.EscapeDataString(storageDomainName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageDomainsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the properties of the specified storage domain name. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageDomainsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/storageDomains/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}'"); + } + + // replace URI parameters with values from identity + var storageDomainName = _match.Groups["storageDomainName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/storageDomains/" + + storageDomainName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageDomainsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageDomainsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomain.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The storage domain name. + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageDomainsGet_Validate(string storageDomainName, string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(storageDomainName),storageDomainName); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + + /// Retrieves all the storage domains in a manager. + /// The subscription id + /// The resource group name + /// The manager name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageDomainsListByManager(string subscriptionId, string resourceGroupName, string managerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.StorSimple/managers/" + + global::System.Uri.EscapeDataString(managerName) + + "/storageDomains" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageDomainsListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Retrieves all the storage domains in a manager. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageDomainsListByManagerViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + var apiVersion = @"2016-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.StorSimple/managers/(?[^/]+)/storageDomains$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var managerName = _match.Groups["managerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.StorSimple/managers/" + + managerName + + "/storageDomains" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageDomainsListByManager_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageDomainsListByManager_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomainList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The subscription id + /// The resource group name + /// The manager name + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageDomainsListByManager_Validate(string subscriptionId, string resourceGroupName, string managerName, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(managerName),managerName); + await eventListener.AssertMinimumLength(nameof(managerName),managerName,2); + await eventListener.AssertMaximumLength(nameof(managerName),managerName,50); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertEmailNotificationStatus.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertEmailNotificationStatus.Completer.cs new file mode 100644 index 000000000000..1024a4723877 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertEmailNotificationStatus.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// + /// Value indicating whether user/admins will receive emails when an alert condition occurs on the system + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatusTypeConverter))] + public partial struct AlertEmailNotificationStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertEmailNotificationStatus.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertEmailNotificationStatus.TypeConverter.cs new file mode 100644 index 000000000000..1ae541e61381 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertEmailNotificationStatus.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// + /// Value indicating whether user/admins will receive emails when an alert condition occurs on the system + /// + public partial class AlertEmailNotificationStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AlertEmailNotificationStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertEmailNotificationStatus.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertEmailNotificationStatus.cs new file mode 100644 index 000000000000..569f991a2a63 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertEmailNotificationStatus.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// + /// Value indicating whether user/admins will receive emails when an alert condition occurs on the system + /// + public partial struct AlertEmailNotificationStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus Enabled = @"Enabled"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private AlertEmailNotificationStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AlertEmailNotificationStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AlertEmailNotificationStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AlertEmailNotificationStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AlertEmailNotificationStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AlertEmailNotificationStatus && Equals((AlertEmailNotificationStatus)obj); + } + + /// Returns hashCode for enum AlertEmailNotificationStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AlertEmailNotificationStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AlertEmailNotificationStatus + /// the value to convert to an instance of . + + public static implicit operator AlertEmailNotificationStatus(string value) + { + return new AlertEmailNotificationStatus(value); + } + + /// Implicit operator to convert AlertEmailNotificationStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus e) + { + return e._value; + } + + /// Overriding != operator for enum AlertEmailNotificationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AlertEmailNotificationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertScope.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertScope.Completer.cs new file mode 100644 index 000000000000..6269943c72c7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertScope.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Device or Resource alert + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScopeTypeConverter))] + public partial struct AlertScope : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Resource".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Resource'", "Resource", global::System.Management.Automation.CompletionResultType.ParameterValue, "Resource"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Device".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Device'", "Device", global::System.Management.Automation.CompletionResultType.ParameterValue, "Device"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertScope.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertScope.TypeConverter.cs new file mode 100644 index 000000000000..4763eb1c2fa4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertScope.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Device or Resource alert + public partial class AlertScopeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AlertScope.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertScope.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertScope.cs new file mode 100644 index 000000000000..062605b16374 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertScope.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Device or Resource alert + public partial struct AlertScope : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope Device = @"Device"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope Resource = @"Resource"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AlertScope(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AlertScope + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AlertScope(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AlertScope + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AlertScope (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AlertScope && Equals((AlertScope)obj); + } + + /// Returns hashCode for enum AlertScope + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AlertScope + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AlertScope + /// the value to convert to an instance of . + + public static implicit operator AlertScope(string value) + { + return new AlertScope(value); + } + + /// Implicit operator to convert AlertScope to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope e) + { + return e._value; + } + + /// Overriding != operator for enum AlertScope + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AlertScope + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertScope e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertSeverity.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertSeverity.Completer.cs new file mode 100644 index 000000000000..9b7862237466 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertSeverity.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Severity of the alert + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverityTypeConverter))] + public partial struct AlertSeverity : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Informational".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Informational'", "Informational", global::System.Management.Automation.CompletionResultType.ParameterValue, "Informational"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Warning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Warning'", "Warning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Warning"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Critical".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Critical'", "Critical", global::System.Management.Automation.CompletionResultType.ParameterValue, "Critical"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertSeverity.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertSeverity.TypeConverter.cs new file mode 100644 index 000000000000..93907f89699c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertSeverity.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Severity of the alert + public partial class AlertSeverityTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AlertSeverity.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertSeverity.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertSeverity.cs new file mode 100644 index 000000000000..f7643971907d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertSeverity.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Severity of the alert + public partial struct AlertSeverity : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity Critical = @"Critical"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity Informational = @"Informational"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity Warning = @"Warning"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AlertSeverity(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AlertSeverity + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AlertSeverity(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AlertSeverity + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AlertSeverity (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AlertSeverity && Equals((AlertSeverity)obj); + } + + /// Returns hashCode for enum AlertSeverity + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AlertSeverity + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AlertSeverity + /// the value to convert to an instance of . + + public static implicit operator AlertSeverity(string value) + { + return new AlertSeverity(value); + } + + /// Implicit operator to convert AlertSeverity to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity e) + { + return e._value; + } + + /// Overriding != operator for enum AlertSeverity + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AlertSeverity + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSeverity e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertSourceType.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertSourceType.Completer.cs new file mode 100644 index 000000000000..71801f7c9677 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertSourceType.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Source of the alert + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceTypeTypeConverter))] + public partial struct AlertSourceType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Resource".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Resource'", "Resource", global::System.Management.Automation.CompletionResultType.ParameterValue, "Resource"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Device".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Device'", "Device", global::System.Management.Automation.CompletionResultType.ParameterValue, "Device"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertSourceType.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertSourceType.TypeConverter.cs new file mode 100644 index 000000000000..6f824b7a2656 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertSourceType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Source of the alert + public partial class AlertSourceTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AlertSourceType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertSourceType.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertSourceType.cs new file mode 100644 index 000000000000..7d531190b194 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertSourceType.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Source of the alert + public partial struct AlertSourceType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType Device = @"Device"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType Resource = @"Resource"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AlertSourceType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AlertSourceType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AlertSourceType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AlertSourceType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AlertSourceType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AlertSourceType && Equals((AlertSourceType)obj); + } + + /// Returns hashCode for enum AlertSourceType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AlertSourceType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AlertSourceType + /// the value to convert to an instance of . + + public static implicit operator AlertSourceType(string value) + { + return new AlertSourceType(value); + } + + /// Implicit operator to convert AlertSourceType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType e) + { + return e._value; + } + + /// Overriding != operator for enum AlertSourceType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AlertSourceType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertSourceType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertStatus.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertStatus.Completer.cs new file mode 100644 index 000000000000..a0384a76e9e0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertStatus.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Status of the alert + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatusTypeConverter))] + public partial struct AlertStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Active".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Active'", "Active", global::System.Management.Automation.CompletionResultType.ParameterValue, "Active"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cleared".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cleared'", "Cleared", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cleared"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertStatus.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertStatus.TypeConverter.cs new file mode 100644 index 000000000000..6a9f4c50d483 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Status of the alert + public partial class AlertStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AlertStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AlertStatus.cs b/swaggerci/storSimple1200Series/generated/api/Support/AlertStatus.cs new file mode 100644 index 000000000000..bb75bc2eb477 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AlertStatus.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Status of the alert + public partial struct AlertStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus Active = @"Active"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus Cleared = @"Cleared"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AlertStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AlertStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AlertStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AlertStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AlertStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AlertStatus && Equals((AlertStatus)obj); + } + + /// Returns hashCode for enum AlertStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AlertStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AlertStatus + /// the value to convert to an instance of . + + public static implicit operator AlertStatus(string value) + { + return new AlertStatus(value); + } + + /// Implicit operator to convert AlertStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus e) + { + return e._value; + } + + /// Overriding != operator for enum AlertStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AlertStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AuthType.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/AuthType.Completer.cs new file mode 100644 index 000000000000..6600d7349c81 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AuthType.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Specify the Authentication type + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthTypeTypeConverter))] + public partial struct AuthType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AccessControlService".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AccessControlService'", "AccessControlService", global::System.Management.Automation.CompletionResultType.ParameterValue, "AccessControlService"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureActiveDirectory".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureActiveDirectory'", "AzureActiveDirectory", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureActiveDirectory"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AuthType.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/AuthType.TypeConverter.cs new file mode 100644 index 000000000000..330db9f947d6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AuthType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Specify the Authentication type + public partial class AuthTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AuthType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/AuthType.cs b/swaggerci/storSimple1200Series/generated/api/Support/AuthType.cs new file mode 100644 index 000000000000..917f27ecd99e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/AuthType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Specify the Authentication type + public partial struct AuthType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType AccessControlService = @"AccessControlService"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType AzureActiveDirectory = @"AzureActiveDirectory"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType Invalid = @"Invalid"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AuthType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AuthType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AuthType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AuthType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AuthType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AuthType && Equals((AuthType)obj); + } + + /// Returns hashCode for enum AuthType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AuthType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AuthType + /// the value to convert to an instance of . + + public static implicit operator AuthType(string value) + { + return new AuthType(value); + } + + /// Implicit operator to convert AuthType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType e) + { + return e._value; + } + + /// Overriding != operator for enum AuthType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AuthType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/CloudType.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/CloudType.Completer.cs new file mode 100644 index 000000000000..c38ea37ea8fb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/CloudType.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The cloud service provider + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudTypeTypeConverter))] + public partial struct CloudType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Azure".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Azure'", "Azure", global::System.Management.Automation.CompletionResultType.ParameterValue, "Azure"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "S3".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'S3'", "S3", global::System.Management.Automation.CompletionResultType.ParameterValue, "S3"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "S3_RRS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'S3_RRS'", "S3_RRS", global::System.Management.Automation.CompletionResultType.ParameterValue, "S3_RRS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "OpenStack".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'OpenStack'", "OpenStack", global::System.Management.Automation.CompletionResultType.ParameterValue, "OpenStack"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "HP".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'HP'", "HP", global::System.Management.Automation.CompletionResultType.ParameterValue, "HP"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/CloudType.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/CloudType.TypeConverter.cs new file mode 100644 index 000000000000..beeacea08b44 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/CloudType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The cloud service provider + public partial class CloudTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CloudType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/CloudType.cs b/swaggerci/storSimple1200Series/generated/api/Support/CloudType.cs new file mode 100644 index 000000000000..79c81f421888 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/CloudType.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The cloud service provider + public partial struct CloudType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType Azure = @"Azure"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType Hp = @"HP"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType OpenStack = @"OpenStack"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType S3 = @"S3"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType S3Rrs = @"S3_RRS"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private CloudType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to CloudType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new CloudType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type CloudType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type CloudType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is CloudType && Equals((CloudType)obj); + } + + /// Returns hashCode for enum CloudType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for CloudType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to CloudType + /// the value to convert to an instance of . + + public static implicit operator CloudType(string value) + { + return new CloudType(value); + } + + /// Implicit operator to convert CloudType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType e) + { + return e._value; + } + + /// Overriding != operator for enum CloudType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum CloudType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/ContractVersions.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/ContractVersions.Completer.cs new file mode 100644 index 000000000000..a2bc377c2142 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/ContractVersions.Completer.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Gets ContractVersion + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersionsTypeConverter))] + public partial struct ContractVersions : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvalidVersion".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InvalidVersion'", "InvalidVersion", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvalidVersion"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2011_09".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2011_09'", "V2011_09", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2011_09"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2012_02".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2012_02'", "V2012_02", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2012_02"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2012_05".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2012_05'", "V2012_05", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2012_05"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2012_12".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2012_12'", "V2012_12", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2012_12"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2013_04".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2013_04'", "V2013_04", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2013_04"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2013_10".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2013_10'", "V2013_10", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2013_10"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2013_11".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2013_11'", "V2013_11", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2013_11"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2014_04".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2014_04'", "V2014_04", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2014_04"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2014_06".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2014_06'", "V2014_06", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2014_06"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2014_07".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2014_07'", "V2014_07", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2014_07"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2014_09".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2014_09'", "V2014_09", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2014_09"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2014_10".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2014_10'", "V2014_10", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2014_10"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2014_12".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2014_12'", "V2014_12", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2014_12"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2015_01".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2015_01'", "V2015_01", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2015_01"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2015_02".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2015_02'", "V2015_02", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2015_02"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2015_04".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2015_04'", "V2015_04", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2015_04"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2015_05".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2015_05'", "V2015_05", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2015_05"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2015_06".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2015_06'", "V2015_06", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2015_06"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2015_07".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2015_07'", "V2015_07", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2015_07"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2015_08".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2015_08'", "V2015_08", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2015_08"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2015_10".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2015_10'", "V2015_10", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2015_10"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2015_12".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2015_12'", "V2015_12", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2015_12"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2016_01".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2016_01'", "V2016_01", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2016_01"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2016_02".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2016_02'", "V2016_02", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2016_02"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2016_04".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2016_04'", "V2016_04", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2016_04"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2016_05".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2016_05'", "V2016_05", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2016_05"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2016_07".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2016_07'", "V2016_07", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2016_07"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "V2016_08".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'V2016_08'", "V2016_08", global::System.Management.Automation.CompletionResultType.ParameterValue, "V2016_08"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/ContractVersions.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/ContractVersions.TypeConverter.cs new file mode 100644 index 000000000000..c67dfc4fad90 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/ContractVersions.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Gets ContractVersion + public partial class ContractVersionsTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ContractVersions.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/ContractVersions.cs b/swaggerci/storSimple1200Series/generated/api/Support/ContractVersions.cs new file mode 100644 index 000000000000..7e31f27213fd --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/ContractVersions.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Gets ContractVersion + public partial struct ContractVersions : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions InvalidVersion = @"InvalidVersion"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201109 = @"V2011_09"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201202 = @"V2012_02"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201205 = @"V2012_05"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201212 = @"V2012_12"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201304 = @"V2013_04"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201310 = @"V2013_10"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201311 = @"V2013_11"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201404 = @"V2014_04"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201406 = @"V2014_06"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201407 = @"V2014_07"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201409 = @"V2014_09"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201410 = @"V2014_10"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201412 = @"V2014_12"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201501 = @"V2015_01"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201502 = @"V2015_02"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201504 = @"V2015_04"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201505 = @"V2015_05"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201506 = @"V2015_06"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201507 = @"V2015_07"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201508 = @"V2015_08"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201510 = @"V2015_10"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201512 = @"V2015_12"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201601 = @"V2016_01"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201602 = @"V2016_02"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201604 = @"V2016_04"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201605 = @"V2016_05"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201607 = @"V2016_07"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions V201608 = @"V2016_08"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ContractVersions(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ContractVersions + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ContractVersions(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ContractVersions + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ContractVersions (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ContractVersions && Equals((ContractVersions)obj); + } + + /// Returns hashCode for enum ContractVersions + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ContractVersions + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ContractVersions + /// the value to convert to an instance of . + + public static implicit operator ContractVersions(string value) + { + return new ContractVersions(value); + } + + /// Implicit operator to convert ContractVersions to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions e) + { + return e._value; + } + + /// Overriding != operator for enum ContractVersions + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ContractVersions + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ContractVersions e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DataPolicy.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/DataPolicy.Completer.cs new file mode 100644 index 000000000000..073c2fa03115 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DataPolicy.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The data policy of backed up endpoint. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicyTypeConverter))] + public partial struct DataPolicy : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Local".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Local'", "Local", global::System.Management.Automation.CompletionResultType.ParameterValue, "Local"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Tiered".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Tiered'", "Tiered", global::System.Management.Automation.CompletionResultType.ParameterValue, "Tiered"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cloud".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cloud'", "Cloud", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cloud"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DataPolicy.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/DataPolicy.TypeConverter.cs new file mode 100644 index 000000000000..c038d10a44c9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DataPolicy.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The data policy of backed up endpoint. + public partial class DataPolicyTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DataPolicy.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DataPolicy.cs b/swaggerci/storSimple1200Series/generated/api/Support/DataPolicy.cs new file mode 100644 index 000000000000..285ad7a6c1a8 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DataPolicy.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The data policy of backed up endpoint. + public partial struct DataPolicy : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy Cloud = @"Cloud"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy Local = @"Local"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy Tiered = @"Tiered"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DataPolicy + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DataPolicy(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DataPolicy(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DataPolicy + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DataPolicy (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DataPolicy && Equals((DataPolicy)obj); + } + + /// Returns hashCode for enum DataPolicy + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DataPolicy + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DataPolicy + /// the value to convert to an instance of . + + public static implicit operator DataPolicy(string value) + { + return new DataPolicy(value); + } + + /// Implicit operator to convert DataPolicy to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy e) + { + return e._value; + } + + /// Overriding != operator for enum DataPolicy + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DataPolicy + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DeviceConfigurationStatus.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/DeviceConfigurationStatus.Completer.cs new file mode 100644 index 000000000000..e6548ec96a40 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DeviceConfigurationStatus.Completer.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// + /// "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 + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatusTypeConverter))] + public partial struct DeviceConfigurationStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Complete".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Complete'", "Complete", global::System.Management.Automation.CompletionResultType.ParameterValue, "Complete"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Pending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Pending'", "Pending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Pending"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DeviceConfigurationStatus.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/DeviceConfigurationStatus.TypeConverter.cs new file mode 100644 index 000000000000..a406c8077634 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DeviceConfigurationStatus.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// + /// "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 + /// + public partial class DeviceConfigurationStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DeviceConfigurationStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DeviceConfigurationStatus.cs b/swaggerci/storSimple1200Series/generated/api/Support/DeviceConfigurationStatus.cs new file mode 100644 index 000000000000..fcf33e296718 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DeviceConfigurationStatus.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// + /// "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 + /// + public partial struct DeviceConfigurationStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus Complete = @"Complete"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus Pending = @"Pending"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DeviceConfigurationStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DeviceConfigurationStatus(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DeviceConfigurationStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DeviceConfigurationStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DeviceConfigurationStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DeviceConfigurationStatus && Equals((DeviceConfigurationStatus)obj); + } + + /// Returns hashCode for enum DeviceConfigurationStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DeviceConfigurationStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DeviceConfigurationStatus + /// the value to convert to an instance of . + + public static implicit operator DeviceConfigurationStatus(string value) + { + return new DeviceConfigurationStatus(value); + } + + /// Implicit operator to convert DeviceConfigurationStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus e) + { + return e._value; + } + + /// Overriding != operator for enum DeviceConfigurationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DeviceConfigurationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceConfigurationStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DeviceOperation.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/DeviceOperation.Completer.cs new file mode 100644 index 000000000000..8c64cfbbad97 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DeviceOperation.Completer.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Argument completer implementation for DeviceOperation. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperationTypeConverter))] + public partial struct DeviceOperation : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Delete".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Delete'", "Delete", global::System.Management.Automation.CompletionResultType.ParameterValue, "Delete"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DeleteWithWarning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DeleteWithWarning'", "DeleteWithWarning", global::System.Management.Automation.CompletionResultType.ParameterValue, "DeleteWithWarning"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DRSource".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DRSource'", "DRSource", global::System.Management.Automation.CompletionResultType.ParameterValue, "DRSource"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DRTarget".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DRTarget'", "DRTarget", global::System.Management.Automation.CompletionResultType.ParameterValue, "DRTarget"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Browsable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Browsable'", "Browsable", global::System.Management.Automation.CompletionResultType.ParameterValue, "Browsable"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReadOnlyForDR".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ReadOnlyForDR'", "ReadOnlyForDR", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReadOnlyForDR"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deactivate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deactivate'", "Deactivate", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deactivate"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DeviceOperation.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/DeviceOperation.TypeConverter.cs new file mode 100644 index 000000000000..9ea14e106246 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DeviceOperation.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// TypeConverter implementation for DeviceOperation. + public partial class DeviceOperationTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DeviceOperation.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DeviceOperation.cs b/swaggerci/storSimple1200Series/generated/api/Support/DeviceOperation.cs new file mode 100644 index 000000000000..815e3b5c51ad --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DeviceOperation.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + public partial struct DeviceOperation : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation Browsable = @"Browsable"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation Deactivate = @"Deactivate"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation Delete = @"Delete"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation DeleteWithWarning = @"DeleteWithWarning"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation DrSource = @"DRSource"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation DrTarget = @"DRTarget"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation ReadOnlyForDr = @"ReadOnlyForDR"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DeviceOperation + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DeviceOperation(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DeviceOperation(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DeviceOperation + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DeviceOperation (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DeviceOperation && Equals((DeviceOperation)obj); + } + + /// Returns hashCode for enum DeviceOperation + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DeviceOperation + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DeviceOperation + /// the value to convert to an instance of . + + public static implicit operator DeviceOperation(string value) + { + return new DeviceOperation(value); + } + + /// Implicit operator to convert DeviceOperation to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation e) + { + return e._value; + } + + /// Overriding != operator for enum DeviceOperation + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DeviceOperation + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceOperation e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DeviceStatus.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/DeviceStatus.Completer.cs new file mode 100644 index 000000000000..0a23e5a8ec19 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DeviceStatus.Completer.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Current status of the device + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatusTypeConverter))] + public partial struct DeviceStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unknown'", "Unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unknown"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Online".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Online'", "Online", global::System.Management.Automation.CompletionResultType.ParameterValue, "Online"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Offline".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Offline'", "Offline", global::System.Management.Automation.CompletionResultType.ParameterValue, "Offline"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RequiresAttention".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RequiresAttention'", "RequiresAttention", global::System.Management.Automation.CompletionResultType.ParameterValue, "RequiresAttention"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MaintenanceMode".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MaintenanceMode'", "MaintenanceMode", global::System.Management.Automation.CompletionResultType.ParameterValue, "MaintenanceMode"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleted'", "Deleted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleted"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReadyToSetup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ReadyToSetup'", "ReadyToSetup", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReadyToSetup"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deactivated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deactivated'", "Deactivated", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deactivated"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deactivating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deactivating'", "Deactivating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deactivating"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DeviceStatus.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/DeviceStatus.TypeConverter.cs new file mode 100644 index 000000000000..72baf4178fa1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DeviceStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Current status of the device + public partial class DeviceStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DeviceStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DeviceStatus.cs b/swaggerci/storSimple1200Series/generated/api/Support/DeviceStatus.cs new file mode 100644 index 000000000000..685937e23173 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DeviceStatus.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Current status of the device + public partial struct DeviceStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus Deactivated = @"Deactivated"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus Deactivating = @"Deactivating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus Deleted = @"Deleted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus MaintenanceMode = @"MaintenanceMode"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus Offline = @"Offline"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus Online = @"Online"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus Provisioning = @"Provisioning"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus ReadyToSetup = @"ReadyToSetup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus RequiresAttention = @"RequiresAttention"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus Unknown = @"Unknown"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DeviceStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DeviceStatus(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DeviceStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DeviceStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DeviceStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DeviceStatus && Equals((DeviceStatus)obj); + } + + /// Returns hashCode for enum DeviceStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DeviceStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DeviceStatus + /// the value to convert to an instance of . + + public static implicit operator DeviceStatus(string value) + { + return new DeviceStatus(value); + } + + /// Implicit operator to convert DeviceStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus e) + { + return e._value; + } + + /// Overriding != operator for enum DeviceStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DeviceStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DeviceType.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/DeviceType.Completer.cs new file mode 100644 index 000000000000..a6981e3d5484 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DeviceType.Completer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Type of the device + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceTypeTypeConverter))] + public partial struct DeviceType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Appliance".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Appliance'", "Appliance", global::System.Management.Automation.CompletionResultType.ParameterValue, "Appliance"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "VirtualAppliance".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'VirtualAppliance'", "VirtualAppliance", global::System.Management.Automation.CompletionResultType.ParameterValue, "VirtualAppliance"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Series9000OnPremVirtualAppliance".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Series9000OnPremVirtualAppliance'", "Series9000OnPremVirtualAppliance", global::System.Management.Automation.CompletionResultType.ParameterValue, "Series9000OnPremVirtualAppliance"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Series9000VirtualAppliance".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Series9000VirtualAppliance'", "Series9000VirtualAppliance", global::System.Management.Automation.CompletionResultType.ParameterValue, "Series9000VirtualAppliance"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Series9000PhysicalAppliance".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Series9000PhysicalAppliance'", "Series9000PhysicalAppliance", global::System.Management.Automation.CompletionResultType.ParameterValue, "Series9000PhysicalAppliance"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DeviceType.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/DeviceType.TypeConverter.cs new file mode 100644 index 000000000000..ce770ad10957 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DeviceType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Type of the device + public partial class DeviceTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DeviceType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DeviceType.cs b/swaggerci/storSimple1200Series/generated/api/Support/DeviceType.cs new file mode 100644 index 000000000000..0e3e226278a9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DeviceType.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Type of the device + public partial struct DeviceType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType Appliance = @"Appliance"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType Series9000OnPremVirtualAppliance = @"Series9000OnPremVirtualAppliance"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType Series9000PhysicalAppliance = @"Series9000PhysicalAppliance"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType Series9000VirtualAppliance = @"Series9000VirtualAppliance"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType VirtualAppliance = @"VirtualAppliance"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DeviceType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DeviceType(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DeviceType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DeviceType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DeviceType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DeviceType && Equals((DeviceType)obj); + } + + /// Returns hashCode for enum DeviceType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DeviceType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DeviceType + /// the value to convert to an instance of . + + public static implicit operator DeviceType(string value) + { + return new DeviceType(value); + } + + /// Implicit operator to convert DeviceType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType e) + { + return e._value; + } + + /// Overriding != operator for enum DeviceType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DeviceType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DeviceType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DhcpStatus.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/DhcpStatus.Completer.cs new file mode 100644 index 000000000000..343f7e182671 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DhcpStatus.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Represents state of DHCP. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatusTypeConverter))] + public partial struct DhcpStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DhcpStatus.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/DhcpStatus.TypeConverter.cs new file mode 100644 index 000000000000..2ce0457c5928 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DhcpStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Represents state of DHCP. + public partial class DhcpStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DhcpStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DhcpStatus.cs b/swaggerci/storSimple1200Series/generated/api/Support/DhcpStatus.cs new file mode 100644 index 000000000000..3479bab4de06 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DhcpStatus.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Represents state of DHCP. + public partial struct DhcpStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DhcpStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DhcpStatus(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DhcpStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DhcpStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DhcpStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DhcpStatus && Equals((DhcpStatus)obj); + } + + /// Returns hashCode for enum DhcpStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DhcpStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DhcpStatus + /// the value to convert to an instance of . + + public static implicit operator DhcpStatus(string value) + { + return new DhcpStatus(value); + } + + /// Implicit operator to convert DhcpStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus e) + { + return e._value; + } + + /// Overriding != operator for enum DhcpStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DhcpStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DhcpStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DiskStatus.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/DiskStatus.Completer.cs new file mode 100644 index 000000000000..ef737f2e51ca --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DiskStatus.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The disk status. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatusTypeConverter))] + public partial struct DiskStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Online".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Online'", "Online", global::System.Management.Automation.CompletionResultType.ParameterValue, "Online"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Offline".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Offline'", "Offline", global::System.Management.Automation.CompletionResultType.ParameterValue, "Offline"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DiskStatus.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/DiskStatus.TypeConverter.cs new file mode 100644 index 000000000000..03409be324f2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DiskStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The disk status. + public partial class DiskStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DiskStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DiskStatus.cs b/swaggerci/storSimple1200Series/generated/api/Support/DiskStatus.cs new file mode 100644 index 000000000000..b3c4833364ca --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DiskStatus.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The disk status. + public partial struct DiskStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus Offline = @"Offline"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus Online = @"Online"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DiskStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DiskStatus(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DiskStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DiskStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DiskStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DiskStatus && Equals((DiskStatus)obj); + } + + /// Returns hashCode for enum DiskStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DiskStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DiskStatus + /// the value to convert to an instance of . + + public static implicit operator DiskStatus(string value) + { + return new DiskStatus(value); + } + + /// Implicit operator to convert DiskStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus e) + { + return e._value; + } + + /// Overriding != operator for enum DiskStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DiskStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DownloadPhase.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/DownloadPhase.Completer.cs new file mode 100644 index 000000000000..6048615321a7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DownloadPhase.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The download phase. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhaseTypeConverter))] + public partial struct DownloadPhase : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unknown'", "Unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unknown"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Initializing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Initializing'", "Initializing", global::System.Management.Automation.CompletionResultType.ParameterValue, "Initializing"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Downloading".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Downloading'", "Downloading", global::System.Management.Automation.CompletionResultType.ParameterValue, "Downloading"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Verifying".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Verifying'", "Verifying", global::System.Management.Automation.CompletionResultType.ParameterValue, "Verifying"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DownloadPhase.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/DownloadPhase.TypeConverter.cs new file mode 100644 index 000000000000..6e5318657c48 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DownloadPhase.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The download phase. + public partial class DownloadPhaseTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DownloadPhase.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/DownloadPhase.cs b/swaggerci/storSimple1200Series/generated/api/Support/DownloadPhase.cs new file mode 100644 index 000000000000..1877fbfe5a6b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/DownloadPhase.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The download phase. + public partial struct DownloadPhase : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase Downloading = @"Downloading"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase Initializing = @"Initializing"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase Unknown = @"Unknown"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase Verifying = @"Verifying"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DownloadPhase + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DownloadPhase(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DownloadPhase(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DownloadPhase + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DownloadPhase (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DownloadPhase && Equals((DownloadPhase)obj); + } + + /// Returns hashCode for enum DownloadPhase + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DownloadPhase + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DownloadPhase + /// the value to convert to an instance of . + + public static implicit operator DownloadPhase(string value) + { + return new DownloadPhase(value); + } + + /// Implicit operator to convert DownloadPhase to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase e) + { + return e._value; + } + + /// Overriding != operator for enum DownloadPhase + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DownloadPhase + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DownloadPhase e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/EncryptionAlgorithm.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/EncryptionAlgorithm.Completer.cs new file mode 100644 index 000000000000..2a064e1e72e4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/EncryptionAlgorithm.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Algorithm used to encrypt "Value" + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithmTypeConverter))] + public partial struct EncryptionAlgorithm : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AES256".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AES256'", "AES256", global::System.Management.Automation.CompletionResultType.ParameterValue, "AES256"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RSAES_PKCS1_v_1_5".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RSAES_PKCS1_v_1_5'", "RSAES_PKCS1_v_1_5", global::System.Management.Automation.CompletionResultType.ParameterValue, "RSAES_PKCS1_v_1_5"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/EncryptionAlgorithm.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/EncryptionAlgorithm.TypeConverter.cs new file mode 100644 index 000000000000..09a64f2836fc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/EncryptionAlgorithm.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Algorithm used to encrypt "Value" + public partial class EncryptionAlgorithmTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => EncryptionAlgorithm.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/EncryptionAlgorithm.cs b/swaggerci/storSimple1200Series/generated/api/Support/EncryptionAlgorithm.cs new file mode 100644 index 000000000000..d0949fb00346 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/EncryptionAlgorithm.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Algorithm used to encrypt "Value" + public partial struct EncryptionAlgorithm : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm Aes256 = @"AES256"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm RsaesPkcs1V15 = @"RSAES_PKCS1_v_1_5"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to EncryptionAlgorithm + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EncryptionAlgorithm(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private EncryptionAlgorithm(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type EncryptionAlgorithm + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type EncryptionAlgorithm (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is EncryptionAlgorithm && Equals((EncryptionAlgorithm)obj); + } + + /// Returns hashCode for enum EncryptionAlgorithm + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EncryptionAlgorithm + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EncryptionAlgorithm + /// the value to convert to an instance of . + + public static implicit operator EncryptionAlgorithm(string value) + { + return new EncryptionAlgorithm(value); + } + + /// Implicit operator to convert EncryptionAlgorithm to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm e) + { + return e._value; + } + + /// Overriding != operator for enum EncryptionAlgorithm + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EncryptionAlgorithm + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/EncryptionStatus.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/EncryptionStatus.Completer.cs new file mode 100644 index 000000000000..7d0dafc4667c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/EncryptionStatus.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The encryption status which indicates if encryption is enabled or not. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatusTypeConverter))] + public partial struct EncryptionStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/EncryptionStatus.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/EncryptionStatus.TypeConverter.cs new file mode 100644 index 000000000000..bdd513ff89e6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/EncryptionStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The encryption status which indicates if encryption is enabled or not. + public partial class EncryptionStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => EncryptionStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/EncryptionStatus.cs b/swaggerci/storSimple1200Series/generated/api/Support/EncryptionStatus.cs new file mode 100644 index 000000000000..c355828e9029 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/EncryptionStatus.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The encryption status which indicates if encryption is enabled or not. + public partial struct EncryptionStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to EncryptionStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EncryptionStatus(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private EncryptionStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type EncryptionStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type EncryptionStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is EncryptionStatus && Equals((EncryptionStatus)obj); + } + + /// Returns hashCode for enum EncryptionStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EncryptionStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EncryptionStatus + /// the value to convert to an instance of . + + public static implicit operator EncryptionStatus(string value) + { + return new EncryptionStatus(value); + } + + /// Implicit operator to convert EncryptionStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus e) + { + return e._value; + } + + /// Overriding != operator for enum EncryptionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EncryptionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/InitiatedBy.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/InitiatedBy.Completer.cs new file mode 100644 index 000000000000..34081f51c04c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/InitiatedBy.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Gets or sets InitiatedBy + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedByTypeConverter))] + public partial struct InitiatedBy : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Manual".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Manual'", "Manual", global::System.Management.Automation.CompletionResultType.ParameterValue, "Manual"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Scheduled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Scheduled'", "Scheduled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Scheduled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/InitiatedBy.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/InitiatedBy.TypeConverter.cs new file mode 100644 index 000000000000..1fb7f2dc77c1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/InitiatedBy.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Gets or sets InitiatedBy + public partial class InitiatedByTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => InitiatedBy.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/InitiatedBy.cs b/swaggerci/storSimple1200Series/generated/api/Support/InitiatedBy.cs new file mode 100644 index 000000000000..801c50d61b32 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/InitiatedBy.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Gets or sets InitiatedBy + public partial struct InitiatedBy : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy Manual = @"Manual"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy Scheduled = @"Scheduled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to InitiatedBy + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new InitiatedBy(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type InitiatedBy + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type InitiatedBy (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is InitiatedBy && Equals((InitiatedBy)obj); + } + + /// Returns hashCode for enum InitiatedBy + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private InitiatedBy(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for InitiatedBy + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to InitiatedBy + /// the value to convert to an instance of . + + public static implicit operator InitiatedBy(string value) + { + return new InitiatedBy(value); + } + + /// Implicit operator to convert InitiatedBy to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy e) + { + return e._value; + } + + /// Overriding != operator for enum InitiatedBy + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum InitiatedBy + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.InitiatedBy e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/JobStatus.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/JobStatus.Completer.cs new file mode 100644 index 000000000000..b11068fc4ea2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/JobStatus.Completer.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Current status of the job + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatusTypeConverter))] + public partial struct JobStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Running".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Running'", "Running", global::System.Management.Automation.CompletionResultType.ParameterValue, "Running"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Paused".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Paused'", "Paused", global::System.Management.Automation.CompletionResultType.ParameterValue, "Paused"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Scheduled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Scheduled'", "Scheduled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Scheduled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/JobStatus.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/JobStatus.TypeConverter.cs new file mode 100644 index 000000000000..7b9671d84f2c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/JobStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Current status of the job + public partial class JobStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => JobStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/JobStatus.cs b/swaggerci/storSimple1200Series/generated/api/Support/JobStatus.cs new file mode 100644 index 000000000000..1983060712cc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/JobStatus.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Current status of the job + public partial struct JobStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus Paused = @"Paused"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus Running = @"Running"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus Scheduled = @"Scheduled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus Succeeded = @"Succeeded"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to JobStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new JobStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type JobStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type JobStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is JobStatus && Equals((JobStatus)obj); + } + + /// Returns hashCode for enum JobStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private JobStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for JobStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to JobStatus + /// the value to convert to an instance of . + + public static implicit operator JobStatus(string value) + { + return new JobStatus(value); + } + + /// Implicit operator to convert JobStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus e) + { + return e._value; + } + + /// Overriding != operator for enum JobStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum JobStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/JobType.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/JobType.Completer.cs new file mode 100644 index 000000000000..c18befbd7db7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/JobType.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The job type. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobTypeTypeConverter))] + public partial struct JobType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Backup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Backup'", "Backup", global::System.Management.Automation.CompletionResultType.ParameterValue, "Backup"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Clone".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Clone'", "Clone", global::System.Management.Automation.CompletionResultType.ParameterValue, "Clone"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failover".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failover'", "Failover", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failover"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DownloadUpdates".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DownloadUpdates'", "DownloadUpdates", global::System.Management.Automation.CompletionResultType.ParameterValue, "DownloadUpdates"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InstallUpdates".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InstallUpdates'", "InstallUpdates", global::System.Management.Automation.CompletionResultType.ParameterValue, "InstallUpdates"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/JobType.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/JobType.TypeConverter.cs new file mode 100644 index 000000000000..a74a14abcffd --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/JobType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The job type. + public partial class JobTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => JobType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/JobType.cs b/swaggerci/storSimple1200Series/generated/api/Support/JobType.cs new file mode 100644 index 000000000000..43a3e34f1734 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/JobType.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The job type. + public partial struct JobType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType Backup = @"Backup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType Clone = @"Clone"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType DownloadUpdates = @"DownloadUpdates"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType Failover = @"Failover"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType InstallUpdates = @"InstallUpdates"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to JobType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new JobType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type JobType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type JobType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is JobType && Equals((JobType)obj); + } + + /// Returns hashCode for enum JobType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private JobType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for JobType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to JobType + /// the value to convert to an instance of . + + public static implicit operator JobType(string value) + { + return new JobType(value); + } + + /// Implicit operator to convert JobType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType e) + { + return e._value; + } + + /// Overriding != operator for enum JobType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum JobType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.JobType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/KeyRolloverStatus.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/KeyRolloverStatus.Completer.cs new file mode 100644 index 000000000000..3b2937b00cd7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/KeyRolloverStatus.Completer.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// + /// The key rollover status which indicates if key rollover is required or not. If secrets encryption has been upgraded, then + /// it requires key rollover. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatusTypeConverter))] + public partial struct KeyRolloverStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Required".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Required'", "Required", global::System.Management.Automation.CompletionResultType.ParameterValue, "Required"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotRequired".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NotRequired'", "NotRequired", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotRequired"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/KeyRolloverStatus.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/KeyRolloverStatus.TypeConverter.cs new file mode 100644 index 000000000000..61c0006c239e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/KeyRolloverStatus.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// + /// The key rollover status which indicates if key rollover is required or not. If secrets encryption has been upgraded, then + /// it requires key rollover. + /// + public partial class KeyRolloverStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => KeyRolloverStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/KeyRolloverStatus.cs b/swaggerci/storSimple1200Series/generated/api/Support/KeyRolloverStatus.cs new file mode 100644 index 000000000000..4e2dd5b06c71 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/KeyRolloverStatus.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// + /// The key rollover status which indicates if key rollover is required or not. If secrets encryption has been upgraded, then + /// it requires key rollover. + /// + public partial struct KeyRolloverStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus NotRequired = @"NotRequired"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus Required = @"Required"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to KeyRolloverStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new KeyRolloverStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type KeyRolloverStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type KeyRolloverStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is KeyRolloverStatus && Equals((KeyRolloverStatus)obj); + } + + /// Returns hashCode for enum KeyRolloverStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private KeyRolloverStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for KeyRolloverStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to KeyRolloverStatus + /// the value to convert to an instance of . + + public static implicit operator KeyRolloverStatus(string value) + { + return new KeyRolloverStatus(value); + } + + /// Implicit operator to convert KeyRolloverStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus e) + { + return e._value; + } + + /// Overriding != operator for enum KeyRolloverStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum KeyRolloverStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.KeyRolloverStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/ManagerType.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/ManagerType.Completer.cs new file mode 100644 index 000000000000..55c7773fc0c7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/ManagerType.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Refers to the type of the StorSimple Manager + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerTypeTypeConverter))] + public partial struct ManagerType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GardaV1".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GardaV1'", "GardaV1", global::System.Management.Automation.CompletionResultType.ParameterValue, "GardaV1"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "HelsinkiV1".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'HelsinkiV1'", "HelsinkiV1", global::System.Management.Automation.CompletionResultType.ParameterValue, "HelsinkiV1"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/ManagerType.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/ManagerType.TypeConverter.cs new file mode 100644 index 000000000000..4e390e742e62 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/ManagerType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Refers to the type of the StorSimple Manager + public partial class ManagerTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ManagerType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/ManagerType.cs b/swaggerci/storSimple1200Series/generated/api/Support/ManagerType.cs new file mode 100644 index 000000000000..413b563e8d6e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/ManagerType.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Refers to the type of the StorSimple Manager + public partial struct ManagerType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType GardaV1 = @"GardaV1"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType HelsinkiV1 = @"HelsinkiV1"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ManagerType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ManagerType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ManagerType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ManagerType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ManagerType && Equals((ManagerType)obj); + } + + /// Returns hashCode for enum ManagerType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ManagerType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ManagerType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ManagerType + /// the value to convert to an instance of . + + public static implicit operator ManagerType(string value) + { + return new ManagerType(value); + } + + /// Implicit operator to convert ManagerType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType e) + { + return e._value; + } + + /// Overriding != operator for enum ManagerType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ManagerType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/MetricAggregationType.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/MetricAggregationType.Completer.cs new file mode 100644 index 000000000000..7b2fe87830e0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/MetricAggregationType.Completer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The metric aggregation type + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationTypeTypeConverter))] + public partial struct MetricAggregationType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Average".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Average'", "Average", global::System.Management.Automation.CompletionResultType.ParameterValue, "Average"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Last".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Last'", "Last", global::System.Management.Automation.CompletionResultType.ParameterValue, "Last"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Maximum".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Maximum'", "Maximum", global::System.Management.Automation.CompletionResultType.ParameterValue, "Maximum"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Minimum".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Minimum'", "Minimum", global::System.Management.Automation.CompletionResultType.ParameterValue, "Minimum"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Total".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Total'", "Total", global::System.Management.Automation.CompletionResultType.ParameterValue, "Total"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/MetricAggregationType.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/MetricAggregationType.TypeConverter.cs new file mode 100644 index 000000000000..6c85321023c1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/MetricAggregationType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The metric aggregation type + public partial class MetricAggregationTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MetricAggregationType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/MetricAggregationType.cs b/swaggerci/storSimple1200Series/generated/api/Support/MetricAggregationType.cs new file mode 100644 index 000000000000..8c0f15a78980 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/MetricAggregationType.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The metric aggregation type + public partial struct MetricAggregationType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType Average = @"Average"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType Last = @"Last"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType Maximum = @"Maximum"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType Minimum = @"Minimum"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType Total = @"Total"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MetricAggregationType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MetricAggregationType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MetricAggregationType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MetricAggregationType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MetricAggregationType && Equals((MetricAggregationType)obj); + } + + /// Returns hashCode for enum MetricAggregationType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private MetricAggregationType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MetricAggregationType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MetricAggregationType + /// the value to convert to an instance of . + + public static implicit operator MetricAggregationType(string value) + { + return new MetricAggregationType(value); + } + + /// Implicit operator to convert MetricAggregationType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType e) + { + return e._value; + } + + /// Overriding != operator for enum MetricAggregationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MetricAggregationType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricAggregationType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/MetricUnit.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/MetricUnit.Completer.cs new file mode 100644 index 000000000000..57a2f94b0bd3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/MetricUnit.Completer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The metric unit + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnitTypeConverter))] + public partial struct MetricUnit : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Bytes".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Bytes'", "Bytes", global::System.Management.Automation.CompletionResultType.ParameterValue, "Bytes"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "BytesPerSecond".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BytesPerSecond'", "BytesPerSecond", global::System.Management.Automation.CompletionResultType.ParameterValue, "BytesPerSecond"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Count".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Count'", "Count", global::System.Management.Automation.CompletionResultType.ParameterValue, "Count"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CountPerSecond".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CountPerSecond'", "CountPerSecond", global::System.Management.Automation.CompletionResultType.ParameterValue, "CountPerSecond"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Percent".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Percent'", "Percent", global::System.Management.Automation.CompletionResultType.ParameterValue, "Percent"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Seconds".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Seconds'", "Seconds", global::System.Management.Automation.CompletionResultType.ParameterValue, "Seconds"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/MetricUnit.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/MetricUnit.TypeConverter.cs new file mode 100644 index 000000000000..7ae95f4096f1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/MetricUnit.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The metric unit + public partial class MetricUnitTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MetricUnit.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/MetricUnit.cs b/swaggerci/storSimple1200Series/generated/api/Support/MetricUnit.cs new file mode 100644 index 000000000000..8738213645ab --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/MetricUnit.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The metric unit + public partial struct MetricUnit : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit Bytes = @"Bytes"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit BytesPerSecond = @"BytesPerSecond"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit Count = @"Count"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit CountPerSecond = @"CountPerSecond"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit Percent = @"Percent"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit Seconds = @"Seconds"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MetricUnit + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MetricUnit(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MetricUnit + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MetricUnit (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MetricUnit && Equals((MetricUnit)obj); + } + + /// Returns hashCode for enum MetricUnit + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private MetricUnit(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MetricUnit + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MetricUnit + /// the value to convert to an instance of . + + public static implicit operator MetricUnit(string value) + { + return new MetricUnit(value); + } + + /// Implicit operator to convert MetricUnit to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit e) + { + return e._value; + } + + /// Overriding != operator for enum MetricUnit + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MetricUnit + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MetricUnit e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/MonitoringStatus.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/MonitoringStatus.Completer.cs new file mode 100644 index 000000000000..0edd826a273f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/MonitoringStatus.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The monitoring status + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatusTypeConverter))] + public partial struct MonitoringStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/MonitoringStatus.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/MonitoringStatus.TypeConverter.cs new file mode 100644 index 000000000000..ece805a8c071 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/MonitoringStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The monitoring status + public partial class MonitoringStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MonitoringStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/MonitoringStatus.cs b/swaggerci/storSimple1200Series/generated/api/Support/MonitoringStatus.cs new file mode 100644 index 000000000000..e24afd3d245e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/MonitoringStatus.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The monitoring status + public partial struct MonitoringStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MonitoringStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MonitoringStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MonitoringStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MonitoringStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MonitoringStatus && Equals((MonitoringStatus)obj); + } + + /// Returns hashCode for enum MonitoringStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private MonitoringStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MonitoringStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MonitoringStatus + /// the value to convert to an instance of . + + public static implicit operator MonitoringStatus(string value) + { + return new MonitoringStatus(value); + } + + /// Implicit operator to convert MonitoringStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus e) + { + return e._value; + } + + /// Overriding != operator for enum MonitoringStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MonitoringStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/ServiceOwnersAlertNotificationStatus.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/ServiceOwnersAlertNotificationStatus.Completer.cs new file mode 100644 index 000000000000..e9e55768611e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/ServiceOwnersAlertNotificationStatus.Completer.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// + /// Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only + /// if emailNotification flag is Enabled. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatusTypeConverter))] + public partial struct ServiceOwnersAlertNotificationStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/ServiceOwnersAlertNotificationStatus.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/ServiceOwnersAlertNotificationStatus.TypeConverter.cs new file mode 100644 index 000000000000..f7ec3dfe4263 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/ServiceOwnersAlertNotificationStatus.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// + /// Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only + /// if emailNotification flag is Enabled. + /// + public partial class ServiceOwnersAlertNotificationStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ServiceOwnersAlertNotificationStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/ServiceOwnersAlertNotificationStatus.cs b/swaggerci/storSimple1200Series/generated/api/Support/ServiceOwnersAlertNotificationStatus.cs new file mode 100644 index 000000000000..3d55db52cdb6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/ServiceOwnersAlertNotificationStatus.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// + /// Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only + /// if emailNotification flag is Enabled. + /// + public partial struct ServiceOwnersAlertNotificationStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus Enabled = @"Enabled"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to ServiceOwnersAlertNotificationStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ServiceOwnersAlertNotificationStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ServiceOwnersAlertNotificationStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type ServiceOwnersAlertNotificationStatus (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ServiceOwnersAlertNotificationStatus && Equals((ServiceOwnersAlertNotificationStatus)obj); + } + + /// Returns hashCode for enum ServiceOwnersAlertNotificationStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private ServiceOwnersAlertNotificationStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ServiceOwnersAlertNotificationStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ServiceOwnersAlertNotificationStatus + /// the value to convert to an instance of . + + public static implicit operator ServiceOwnersAlertNotificationStatus(string value) + { + return new ServiceOwnersAlertNotificationStatus(value); + } + + /// Implicit operator to convert ServiceOwnersAlertNotificationStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus e) + { + return e._value; + } + + /// Overriding != operator for enum ServiceOwnersAlertNotificationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ServiceOwnersAlertNotificationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/ShareStatus.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/ShareStatus.Completer.cs new file mode 100644 index 000000000000..5b37bc7cfa28 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/ShareStatus.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The Share Status + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatusTypeConverter))] + public partial struct ShareStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Online".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Online'", "Online", global::System.Management.Automation.CompletionResultType.ParameterValue, "Online"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Offline".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Offline'", "Offline", global::System.Management.Automation.CompletionResultType.ParameterValue, "Offline"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/ShareStatus.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/ShareStatus.TypeConverter.cs new file mode 100644 index 000000000000..0812f65cf03c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/ShareStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The Share Status + public partial class ShareStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ShareStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/ShareStatus.cs b/swaggerci/storSimple1200Series/generated/api/Support/ShareStatus.cs new file mode 100644 index 000000000000..66eadcb85357 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/ShareStatus.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The Share Status + public partial struct ShareStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus Offline = @"Offline"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus Online = @"Online"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ShareStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ShareStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ShareStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ShareStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ShareStatus && Equals((ShareStatus)obj); + } + + /// Returns hashCode for enum ShareStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ShareStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ShareStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ShareStatus + /// the value to convert to an instance of . + + public static implicit operator ShareStatus(string value) + { + return new ShareStatus(value); + } + + /// Implicit operator to convert ShareStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus e) + { + return e._value; + } + + /// Overriding != operator for enum ShareStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ShareStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/SslStatus.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/SslStatus.Completer.cs new file mode 100644 index 000000000000..a9b5da8db5fe --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/SslStatus.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// SSL needs to be enabled or not + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatusTypeConverter))] + public partial struct SslStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/SslStatus.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/SslStatus.TypeConverter.cs new file mode 100644 index 000000000000..8a118bf375ea --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/SslStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// SSL needs to be enabled or not + public partial class SslStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SslStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/SslStatus.cs b/swaggerci/storSimple1200Series/generated/api/Support/SslStatus.cs new file mode 100644 index 000000000000..43a5fb385574 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/SslStatus.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// SSL needs to be enabled or not + public partial struct SslStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SslStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SslStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SslStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SslStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SslStatus && Equals((SslStatus)obj); + } + + /// Returns hashCode for enum SslStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private SslStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SslStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SslStatus + /// the value to convert to an instance of . + + public static implicit operator SslStatus(string value) + { + return new SslStatus(value); + } + + /// Implicit operator to convert SslStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus e) + { + return e._value; + } + + /// Overriding != operator for enum SslStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SslStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/SupportedDeviceCapabilities.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/SupportedDeviceCapabilities.Completer.cs new file mode 100644 index 000000000000..93cbc3759746 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/SupportedDeviceCapabilities.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// Argument completer implementation for SupportedDeviceCapabilities. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilitiesTypeConverter))] + public partial struct SupportedDeviceCapabilities : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FileServer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FileServer'", "FileServer", global::System.Management.Automation.CompletionResultType.ParameterValue, "FileServer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "IscsiServer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'IscsiServer'", "IscsiServer", global::System.Management.Automation.CompletionResultType.ParameterValue, "IscsiServer"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/SupportedDeviceCapabilities.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/SupportedDeviceCapabilities.TypeConverter.cs new file mode 100644 index 000000000000..705a917be645 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/SupportedDeviceCapabilities.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// TypeConverter implementation for SupportedDeviceCapabilities. + public partial class SupportedDeviceCapabilitiesTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SupportedDeviceCapabilities.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/SupportedDeviceCapabilities.cs b/swaggerci/storSimple1200Series/generated/api/Support/SupportedDeviceCapabilities.cs new file mode 100644 index 000000000000..6740922c444d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/SupportedDeviceCapabilities.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + public partial struct SupportedDeviceCapabilities : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities FileServer = @"FileServer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities Invalid = @"Invalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities IscsiServer = @"IscsiServer"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to SupportedDeviceCapabilities + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SupportedDeviceCapabilities(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SupportedDeviceCapabilities + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SupportedDeviceCapabilities (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SupportedDeviceCapabilities && Equals((SupportedDeviceCapabilities)obj); + } + + /// Returns hashCode for enum SupportedDeviceCapabilities + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private SupportedDeviceCapabilities(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SupportedDeviceCapabilities + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SupportedDeviceCapabilities + /// the value to convert to an instance of . + + public static implicit operator SupportedDeviceCapabilities(string value) + { + return new SupportedDeviceCapabilities(value); + } + + /// Implicit operator to convert SupportedDeviceCapabilities to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities e) + { + return e._value; + } + + /// Overriding != operator for enum SupportedDeviceCapabilities + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SupportedDeviceCapabilities + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SupportedDeviceCapabilities e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/TargetType.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/TargetType.Completer.cs new file mode 100644 index 000000000000..ca86d4d7fcc7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/TargetType.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The target type of the backup. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetTypeTypeConverter))] + public partial struct TargetType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FileServer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FileServer'", "FileServer", global::System.Management.Automation.CompletionResultType.ParameterValue, "FileServer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DiskServer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DiskServer'", "DiskServer", global::System.Management.Automation.CompletionResultType.ParameterValue, "DiskServer"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/TargetType.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/TargetType.TypeConverter.cs new file mode 100644 index 000000000000..e4d5c8922371 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/TargetType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The target type of the backup. + public partial class TargetTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => TargetType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/TargetType.cs b/swaggerci/storSimple1200Series/generated/api/Support/TargetType.cs new file mode 100644 index 000000000000..2e15842ac43b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/TargetType.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The target type of the backup. + public partial struct TargetType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType DiskServer = @"DiskServer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType FileServer = @"FileServer"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to TargetType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TargetType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TargetType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type TargetType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is TargetType && Equals((TargetType)obj); + } + + /// Returns hashCode for enum TargetType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private TargetType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for TargetType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to TargetType + /// the value to convert to an instance of . + + public static implicit operator TargetType(string value) + { + return new TargetType(value); + } + + /// Implicit operator to convert TargetType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType e) + { + return e._value; + } + + /// Overriding != operator for enum TargetType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TargetType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.TargetType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/UpdateOperation.Completer.cs b/swaggerci/storSimple1200Series/generated/api/Support/UpdateOperation.Completer.cs new file mode 100644 index 000000000000..b5f526cd09eb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/UpdateOperation.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The current update operation. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperationTypeConverter))] + public partial struct UpdateOperation : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Idle".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Idle'", "Idle", global::System.Management.Automation.CompletionResultType.ParameterValue, "Idle"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Scanning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Scanning'", "Scanning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Scanning"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Downloading".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Downloading'", "Downloading", global::System.Management.Automation.CompletionResultType.ParameterValue, "Downloading"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Installing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Installing'", "Installing", global::System.Management.Automation.CompletionResultType.ParameterValue, "Installing"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/UpdateOperation.TypeConverter.cs b/swaggerci/storSimple1200Series/generated/api/Support/UpdateOperation.TypeConverter.cs new file mode 100644 index 000000000000..7aae6049db73 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/UpdateOperation.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The current update operation. + public partial class UpdateOperationTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => UpdateOperation.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/api/Support/UpdateOperation.cs b/swaggerci/storSimple1200Series/generated/api/Support/UpdateOperation.cs new file mode 100644 index 000000000000..49a1a01e5d11 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/api/Support/UpdateOperation.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support +{ + + /// The current update operation. + public partial struct UpdateOperation : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation Downloading = @"Downloading"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation Idle = @"Idle"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation Installing = @"Installing"; + + public static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation Scanning = @"Scanning"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to UpdateOperation + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new UpdateOperation(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type UpdateOperation + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type UpdateOperation (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is UpdateOperation && Equals((UpdateOperation)obj); + } + + /// Returns hashCode for enum UpdateOperation + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for UpdateOperation + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private UpdateOperation(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to UpdateOperation + /// the value to convert to an instance of . + + public static implicit operator UpdateOperation(string value) + { + return new UpdateOperation(value); + } + + /// Implicit operator to convert UpdateOperation to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation e) + { + return e._value; + } + + /// Overriding != operator for enum UpdateOperation + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum UpdateOperation + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation e1, Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.UpdateOperation e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/BackupAzStorSimpleFileServerNow_Backup.cs b/swaggerci/storSimple1200Series/generated/cmdlets/BackupAzStorSimpleFileServerNow_Backup.cs new file mode 100644 index 000000000000..1f44edd70d30 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/BackupAzStorSimpleFileServerNow_Backup.cs @@ -0,0 +1,504 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Backup the file server now. + /// + /// [OpenAPI] BackupNow=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/backup" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Backup, @"AzStorSimpleFileServerNow_Backup", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Backup the file server now.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class BackupAzStorSimpleFileServerNow_Backup : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _fileServerName; + + /// The file server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file server name.", + SerializedName = @"fileServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string FileServerName { get => this._fileServerName; set => this._fileServerName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// Intializes a new instance of the cmdlet class. + /// + public BackupAzStorSimpleFileServerNow_Backup() + { + + } + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of BackupAzStorSimpleFileServerNow_Backup + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.BackupAzStorSimpleFileServerNow_Backup Clone() + { + var clone = new BackupAzStorSimpleFileServerNow_Backup(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.FileServerName = this.FileServerName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileServersBackupNow' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileServersBackupNow(DeviceName, FileServerName, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,FileServerName=FileServerName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/BackupAzStorSimpleFileServerNow_BackupViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/BackupAzStorSimpleFileServerNow_BackupViaIdentity.cs new file mode 100644 index 000000000000..2f9b5b4b2a2e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/BackupAzStorSimpleFileServerNow_BackupViaIdentity.cs @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Backup the file server now. + /// + /// [OpenAPI] BackupNow=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/backup" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Backup, @"AzStorSimpleFileServerNow_BackupViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Backup the file server now.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class BackupAzStorSimpleFileServerNow_BackupViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// Intializes a new instance of the cmdlet class. + /// + public BackupAzStorSimpleFileServerNow_BackupViaIdentity() + { + + } + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of BackupAzStorSimpleFileServerNow_BackupViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.BackupAzStorSimpleFileServerNow_BackupViaIdentity Clone() + { + var clone = new BackupAzStorSimpleFileServerNow_BackupViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileServersBackupNow' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FileServersBackupNowViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FileServerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FileServerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FileServersBackupNow(InputObject.DeviceName ?? null, InputObject.FileServerName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/BackupAzStorSimpleIscsiServerNow_Backup.cs b/swaggerci/storSimple1200Series/generated/cmdlets/BackupAzStorSimpleIscsiServerNow_Backup.cs new file mode 100644 index 000000000000..7f5b3a2517b1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/BackupAzStorSimpleIscsiServerNow_Backup.cs @@ -0,0 +1,504 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Backup the iSCSI server now. + /// + /// [OpenAPI] BackupNow=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/backup" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Backup, @"AzStorSimpleIscsiServerNow_Backup", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Backup the iSCSI server now.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class BackupAzStorSimpleIscsiServerNow_Backup : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iscsiServerName; + + /// The iSCSI server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI server name.", + SerializedName = @"iscsiServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string IscsiServerName { get => this._iscsiServerName; set => this._iscsiServerName = value; } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// Intializes a new instance of the cmdlet class. + /// + public BackupAzStorSimpleIscsiServerNow_Backup() + { + + } + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of BackupAzStorSimpleIscsiServerNow_Backup + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.BackupAzStorSimpleIscsiServerNow_Backup Clone() + { + var clone = new BackupAzStorSimpleIscsiServerNow_Backup(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.IscsiServerName = this.IscsiServerName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IscsiServersBackupNow' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiServersBackupNow(DeviceName, IscsiServerName, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,IscsiServerName=IscsiServerName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/BackupAzStorSimpleIscsiServerNow_BackupViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/BackupAzStorSimpleIscsiServerNow_BackupViaIdentity.cs new file mode 100644 index 000000000000..e2a941ac1fa9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/BackupAzStorSimpleIscsiServerNow_BackupViaIdentity.cs @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Backup the iSCSI server now. + /// + /// [OpenAPI] BackupNow=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/backup" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Backup, @"AzStorSimpleIscsiServerNow_BackupViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Backup the iSCSI server now.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class BackupAzStorSimpleIscsiServerNow_BackupViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// Intializes a new instance of the cmdlet class. + /// + public BackupAzStorSimpleIscsiServerNow_BackupViaIdentity() + { + + } + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of BackupAzStorSimpleIscsiServerNow_BackupViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.BackupAzStorSimpleIscsiServerNow_BackupViaIdentity Clone() + { + var clone = new BackupAzStorSimpleIscsiServerNow_BackupViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IscsiServersBackupNow' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.IscsiServersBackupNowViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.IscsiServerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.IscsiServerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.IscsiServersBackupNow(InputObject.DeviceName ?? null, InputObject.IscsiServerName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/ClearAzStorSimpleAlert_Clear.cs b/swaggerci/storSimple1200Series/generated/cmdlets/ClearAzStorSimpleAlert_Clear.cs new file mode 100644 index 000000000000..498fc65b2872 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/ClearAzStorSimpleAlert_Clear.cs @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Clear the alerts. + /// + /// [OpenAPI] Clear=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/clearAlerts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Clear, @"AzStorSimpleAlert_Clear", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Clear the alerts.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class ClearAzStorSimpleAlert_Clear : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest _request; + + /// Request for clearing the alert + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Request for clearing the alert", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Request for clearing the alert", + SerializedName = @"request", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest Request { get => this._request; set => this._request = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ClearAzStorSimpleAlert_Clear() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AlertsClear' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsClear(SubscriptionId, ResourceGroupName, ManagerName, Request, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=Request}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=Request }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=Request }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/ClearAzStorSimpleAlert_ClearExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/ClearAzStorSimpleAlert_ClearExpanded.cs new file mode 100644 index 000000000000..c543dd4b69b5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/ClearAzStorSimpleAlert_ClearExpanded.cs @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Clear the alerts. + /// + /// [OpenAPI] Clear=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/clearAlerts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Clear, @"AzStorSimpleAlert_ClearExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Clear the alerts.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class ClearAzStorSimpleAlert_ClearExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Request for clearing the alert + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest _requestBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ClearAlertRequest(); + + /// List of alert Ids to be cleared + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "List of alert Ids to be cleared")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of alert Ids to be cleared", + SerializedName = @"alerts", + PossibleTypes = new [] { typeof(string) })] + public string[] Alert { get => _requestBody.Alert ?? null /* arrayOf */; set => _requestBody.Alert = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Resolution message while clearing the request + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resolution message while clearing the request")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resolution message while clearing the request", + SerializedName = @"resolutionMessage", + PossibleTypes = new [] { typeof(string) })] + public string ResolutionMessage { get => _requestBody.ResolutionMessage ?? null; set => _requestBody.ResolutionMessage = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ClearAzStorSimpleAlert_ClearExpanded() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AlertsClear' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsClear(SubscriptionId, ResourceGroupName, ManagerName, _requestBody, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_requestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_requestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_requestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/ClearAzStorSimpleAlert_ClearViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/ClearAzStorSimpleAlert_ClearViaIdentity.cs new file mode 100644 index 000000000000..8c7b100aed37 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/ClearAzStorSimpleAlert_ClearViaIdentity.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Clear the alerts. + /// + /// [OpenAPI] Clear=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/clearAlerts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Clear, @"AzStorSimpleAlert_ClearViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Clear the alerts.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class ClearAzStorSimpleAlert_ClearViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest _request; + + /// Request for clearing the alert + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Request for clearing the alert", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Request for clearing the alert", + SerializedName = @"request", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest Request { get => this._request; set => this._request = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ClearAzStorSimpleAlert_ClearViaIdentity() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AlertsClear' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AlertsClearViaIdentity(InputObject.Id, Request, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AlertsClear(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, Request, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Request}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Request }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Request }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/ClearAzStorSimpleAlert_ClearViaIdentityExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/ClearAzStorSimpleAlert_ClearViaIdentityExpanded.cs new file mode 100644 index 000000000000..8a2d6225fda9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/ClearAzStorSimpleAlert_ClearViaIdentityExpanded.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Clear the alerts. + /// + /// [OpenAPI] Clear=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/clearAlerts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Clear, @"AzStorSimpleAlert_ClearViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Clear the alerts.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class ClearAzStorSimpleAlert_ClearViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Request for clearing the alert + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IClearAlertRequest _requestBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ClearAlertRequest(); + + /// List of alert Ids to be cleared + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "List of alert Ids to be cleared")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of alert Ids to be cleared", + SerializedName = @"alerts", + PossibleTypes = new [] { typeof(string) })] + public string[] Alert { get => _requestBody.Alert ?? null /* arrayOf */; set => _requestBody.Alert = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Resolution message while clearing the request + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resolution message while clearing the request")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resolution message while clearing the request", + SerializedName = @"resolutionMessage", + PossibleTypes = new [] { typeof(string) })] + public string ResolutionMessage { get => _requestBody.ResolutionMessage ?? null; set => _requestBody.ResolutionMessage = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ClearAzStorSimpleAlert_ClearViaIdentityExpanded() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AlertsClear' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AlertsClearViaIdentity(InputObject.Id, _requestBody, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AlertsClear(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, _requestBody, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_requestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_requestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_requestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/CopyAzStorSimpleBackup_Clone.cs b/swaggerci/storSimple1200Series/generated/cmdlets/CopyAzStorSimpleBackup_Clone.cs new file mode 100644 index 000000000000..85d4852e3ca7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/CopyAzStorSimpleBackup_Clone.cs @@ -0,0 +1,534 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Clones the given backup element to a new disk or share with given details. + /// + /// [OpenAPI] Clone=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}/elements/{elementName}/clone" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Copy, @"AzStorSimpleBackup_Clone", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Clones the given backup element to a new disk or share with given details.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class CopyAzStorSimpleBackup_Clone : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest _cloneRequest; + + /// Clone Job Request Model. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Clone Job Request Model.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Clone Job Request Model.", + SerializedName = @"cloneRequest", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest CloneRequest { get => this._cloneRequest; set => this._cloneRequest = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _elementName; + + /// The backup element name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The backup element name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup element name.", + SerializedName = @"elementName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ElementName { get => this._elementName; set => this._elementName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The backup name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The backup name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup name.", + SerializedName = @"backupName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BackupName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of CopyAzStorSimpleBackup_Clone + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.CopyAzStorSimpleBackup_Clone Clone() + { + var clone = new CopyAzStorSimpleBackup_Clone(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.ElementName = this.ElementName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + clone.CloneRequest = this.CloneRequest; + return clone; + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public CopyAzStorSimpleBackup_Clone() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupsClone' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupsClone(DeviceName, Name, ElementName, SubscriptionId, ResourceGroupName, ManagerName, CloneRequest, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,Name=Name,ElementName=ElementName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=CloneRequest}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, ElementName=ElementName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=CloneRequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, ElementName=ElementName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=CloneRequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/CopyAzStorSimpleBackup_CloneExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/CopyAzStorSimpleBackup_CloneExpanded.cs new file mode 100644 index 000000000000..14762300f064 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/CopyAzStorSimpleBackup_CloneExpanded.cs @@ -0,0 +1,699 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Clones the given backup element to a new disk or share with given details. + /// + /// [OpenAPI] Clone=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}/elements/{elementName}/clone" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Copy, @"AzStorSimpleBackup_CloneExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Clones the given backup element to a new disk or share with given details.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class CopyAzStorSimpleBackup_CloneExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Clone Job Request Model. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest _cloneRequestBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.CloneRequest(); + + /// The access control records. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The access control records.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The access control records.", + SerializedName = @"accessControlRecords", + PossibleTypes = new [] { typeof(string) })] + public string[] AccessControlRecord { get => _cloneRequestBody.AccessControlRecord ?? null /* arrayOf */; set => _cloneRequestBody.AccessControlRecord = value; } + + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\\xyz.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\xyz.", + SerializedName = @"adminUser", + PossibleTypes = new [] { typeof(string) })] + public string AdminUser { get => _cloneRequestBody.AdminUser ?? null; set => _cloneRequestBody.AdminUser = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// The data policy. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The data policy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data policy.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DiskPropertiesDataPolicy { get => _cloneRequestBody.DiskPropertiesDataPolicy ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy)""); set => _cloneRequestBody.DiskPropertiesDataPolicy = value; } + + /// The description. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The description.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string DiskPropertiesDescription { get => _cloneRequestBody.DiskPropertiesDescription ?? null; set => _cloneRequestBody.DiskPropertiesDescription = value; } + + /// The monitoring. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The monitoring.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The monitoring.", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus DiskPropertiesMonitoringStatus { get => _cloneRequestBody.DiskPropertiesMonitoringStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus)""); set => _cloneRequestBody.DiskPropertiesMonitoringStatus = value; } + + /// The provisioned capacity in bytes. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The provisioned capacity in bytes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The provisioned capacity in bytes.", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + public long DiskPropertiesProvisionedCapacityInByte { get => _cloneRequestBody.DiskPropertiesProvisionedCapacityInByte ?? default(long); set => _cloneRequestBody.DiskPropertiesProvisionedCapacityInByte = value; } + + /// The disk status. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The disk status.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The disk status.", + SerializedName = @"diskStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus DiskStatus { get => _cloneRequestBody.DiskStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus)""); set => _cloneRequestBody.DiskStatus = value; } + + /// Backing field for property. + private string _elementName; + + /// The backup element name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The backup element name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup element name.", + SerializedName = @"elementName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ElementName { get => this._elementName; set => this._elementName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The backup name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The backup name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup name.", + SerializedName = @"backupName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BackupName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Name of new endpoint which will created as part of clone job. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of new endpoint which will created as part of clone job.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of new endpoint which will created as part of clone job.", + SerializedName = @"newEndpointName", + PossibleTypes = new [] { typeof(string) })] + public string NewEndpointName { get => _cloneRequestBody.NewEndpointName ?? null; set => _cloneRequestBody.NewEndpointName = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// The data policy + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The data policy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data policy", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy SharePropertiesDataPolicy { get => _cloneRequestBody.SharePropertiesDataPolicy ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy)""); set => _cloneRequestBody.SharePropertiesDataPolicy = value; } + + /// Description for file share + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Description for file share")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description for file share", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string SharePropertiesDescription { get => _cloneRequestBody.SharePropertiesDescription ?? null; set => _cloneRequestBody.SharePropertiesDescription = value; } + + /// The monitoring status + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The monitoring status")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The monitoring status", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus SharePropertiesMonitoringStatus { get => _cloneRequestBody.SharePropertiesMonitoringStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus)""); set => _cloneRequestBody.SharePropertiesMonitoringStatus = value; } + + /// The total provisioned capacity in Bytes + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The total provisioned capacity in Bytes")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total provisioned capacity in Bytes", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + public long SharePropertiesProvisionedCapacityInByte { get => _cloneRequestBody.SharePropertiesProvisionedCapacityInByte ?? default(long); set => _cloneRequestBody.SharePropertiesProvisionedCapacityInByte = value; } + + /// The Share Status + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Share Status")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Share Status", + SerializedName = @"shareStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus ShareStatus { get => _cloneRequestBody.ShareStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus)""); set => _cloneRequestBody.ShareStatus = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Access point Id on which clone job will performed. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Access point Id on which clone job will performed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Access point Id on which clone job will performed.", + SerializedName = @"targetAccessPointId", + PossibleTypes = new [] { typeof(string) })] + public string TargetAccessPointId { get => _cloneRequestBody.TargetAccessPointId ?? null; set => _cloneRequestBody.TargetAccessPointId = value; } + + /// DeviceId of the device which will act as the Clone target + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "DeviceId of the device which will act as the Clone target")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"DeviceId of the device which will act as the Clone target", + SerializedName = @"targetDeviceId", + PossibleTypes = new [] { typeof(string) })] + public string TargetDeviceId { get => _cloneRequestBody.TargetDeviceId ?? null; set => _cloneRequestBody.TargetDeviceId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of CopyAzStorSimpleBackup_CloneExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.CopyAzStorSimpleBackup_CloneExpanded Clone() + { + var clone = new CopyAzStorSimpleBackup_CloneExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._cloneRequestBody = this._cloneRequestBody; + clone.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.ElementName = this.ElementName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public CopyAzStorSimpleBackup_CloneExpanded() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupsClone' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupsClone(DeviceName, Name, ElementName, SubscriptionId, ResourceGroupName, ManagerName, _cloneRequestBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,Name=Name,ElementName=ElementName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_cloneRequestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, ElementName=ElementName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_cloneRequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, ElementName=ElementName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_cloneRequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/CopyAzStorSimpleBackup_CloneViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/CopyAzStorSimpleBackup_CloneViaIdentity.cs new file mode 100644 index 000000000000..7445c5296b0b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/CopyAzStorSimpleBackup_CloneViaIdentity.cs @@ -0,0 +1,479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Clones the given backup element to a new disk or share with given details. + /// + /// [OpenAPI] Clone=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}/elements/{elementName}/clone" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Copy, @"AzStorSimpleBackup_CloneViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Clones the given backup element to a new disk or share with given details.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class CopyAzStorSimpleBackup_CloneViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest _cloneRequest; + + /// Clone Job Request Model. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Clone Job Request Model.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Clone Job Request Model.", + SerializedName = @"cloneRequest", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest CloneRequest { get => this._cloneRequest; set => this._cloneRequest = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of CopyAzStorSimpleBackup_CloneViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.CopyAzStorSimpleBackup_CloneViaIdentity Clone() + { + var clone = new CopyAzStorSimpleBackup_CloneViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.CloneRequest = this.CloneRequest; + return clone; + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public CopyAzStorSimpleBackup_CloneViaIdentity() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupsClone' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BackupsCloneViaIdentity(InputObject.Id, CloneRequest, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.BackupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BackupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ElementName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ElementName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BackupsClone(InputObject.DeviceName ?? null, InputObject.BackupName ?? null, InputObject.ElementName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, CloneRequest, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=CloneRequest}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=CloneRequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=CloneRequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/CopyAzStorSimpleBackup_CloneViaIdentityExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/CopyAzStorSimpleBackup_CloneViaIdentityExpanded.cs new file mode 100644 index 000000000000..0a82aa0f472e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/CopyAzStorSimpleBackup_CloneViaIdentityExpanded.cs @@ -0,0 +1,644 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Clones the given backup element to a new disk or share with given details. + /// + /// [OpenAPI] Clone=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}/elements/{elementName}/clone" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Copy, @"AzStorSimpleBackup_CloneViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Clones the given backup element to a new disk or share with given details.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class CopyAzStorSimpleBackup_CloneViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Clone Job Request Model. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ICloneRequest _cloneRequestBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.CloneRequest(); + + /// The access control records. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The access control records.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The access control records.", + SerializedName = @"accessControlRecords", + PossibleTypes = new [] { typeof(string) })] + public string[] AccessControlRecord { get => _cloneRequestBody.AccessControlRecord ?? null /* arrayOf */; set => _cloneRequestBody.AccessControlRecord = value; } + + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\\xyz.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\xyz.", + SerializedName = @"adminUser", + PossibleTypes = new [] { typeof(string) })] + public string AdminUser { get => _cloneRequestBody.AdminUser ?? null; set => _cloneRequestBody.AdminUser = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The data policy. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The data policy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data policy.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DiskPropertiesDataPolicy { get => _cloneRequestBody.DiskPropertiesDataPolicy ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy)""); set => _cloneRequestBody.DiskPropertiesDataPolicy = value; } + + /// The description. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The description.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string DiskPropertiesDescription { get => _cloneRequestBody.DiskPropertiesDescription ?? null; set => _cloneRequestBody.DiskPropertiesDescription = value; } + + /// The monitoring. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The monitoring.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The monitoring.", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus DiskPropertiesMonitoringStatus { get => _cloneRequestBody.DiskPropertiesMonitoringStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus)""); set => _cloneRequestBody.DiskPropertiesMonitoringStatus = value; } + + /// The provisioned capacity in bytes. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The provisioned capacity in bytes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The provisioned capacity in bytes.", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + public long DiskPropertiesProvisionedCapacityInByte { get => _cloneRequestBody.DiskPropertiesProvisionedCapacityInByte ?? default(long); set => _cloneRequestBody.DiskPropertiesProvisionedCapacityInByte = value; } + + /// The disk status. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The disk status.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The disk status.", + SerializedName = @"diskStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus DiskStatus { get => _cloneRequestBody.DiskStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus)""); set => _cloneRequestBody.DiskStatus = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Name of new endpoint which will created as part of clone job. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of new endpoint which will created as part of clone job.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of new endpoint which will created as part of clone job.", + SerializedName = @"newEndpointName", + PossibleTypes = new [] { typeof(string) })] + public string NewEndpointName { get => _cloneRequestBody.NewEndpointName ?? null; set => _cloneRequestBody.NewEndpointName = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The data policy + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The data policy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data policy", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy SharePropertiesDataPolicy { get => _cloneRequestBody.SharePropertiesDataPolicy ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy)""); set => _cloneRequestBody.SharePropertiesDataPolicy = value; } + + /// Description for file share + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Description for file share")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description for file share", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string SharePropertiesDescription { get => _cloneRequestBody.SharePropertiesDescription ?? null; set => _cloneRequestBody.SharePropertiesDescription = value; } + + /// The monitoring status + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The monitoring status")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The monitoring status", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus SharePropertiesMonitoringStatus { get => _cloneRequestBody.SharePropertiesMonitoringStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus)""); set => _cloneRequestBody.SharePropertiesMonitoringStatus = value; } + + /// The total provisioned capacity in Bytes + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The total provisioned capacity in Bytes")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total provisioned capacity in Bytes", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + public long SharePropertiesProvisionedCapacityInByte { get => _cloneRequestBody.SharePropertiesProvisionedCapacityInByte ?? default(long); set => _cloneRequestBody.SharePropertiesProvisionedCapacityInByte = value; } + + /// The Share Status + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Share Status")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Share Status", + SerializedName = @"shareStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus ShareStatus { get => _cloneRequestBody.ShareStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus)""); set => _cloneRequestBody.ShareStatus = value; } + + /// Access point Id on which clone job will performed. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Access point Id on which clone job will performed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Access point Id on which clone job will performed.", + SerializedName = @"targetAccessPointId", + PossibleTypes = new [] { typeof(string) })] + public string TargetAccessPointId { get => _cloneRequestBody.TargetAccessPointId ?? null; set => _cloneRequestBody.TargetAccessPointId = value; } + + /// DeviceId of the device which will act as the Clone target + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "DeviceId of the device which will act as the Clone target")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"DeviceId of the device which will act as the Clone target", + SerializedName = @"targetDeviceId", + PossibleTypes = new [] { typeof(string) })] + public string TargetDeviceId { get => _cloneRequestBody.TargetDeviceId ?? null; set => _cloneRequestBody.TargetDeviceId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of CopyAzStorSimpleBackup_CloneViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.CopyAzStorSimpleBackup_CloneViaIdentityExpanded Clone() + { + var clone = new CopyAzStorSimpleBackup_CloneViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._cloneRequestBody = this._cloneRequestBody; + return clone; + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public CopyAzStorSimpleBackup_CloneViaIdentityExpanded() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupsClone' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BackupsCloneViaIdentity(InputObject.Id, _cloneRequestBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.BackupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BackupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ElementName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ElementName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BackupsClone(InputObject.DeviceName ?? null, InputObject.BackupName ?? null, InputObject.ElementName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, _cloneRequestBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_cloneRequestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_cloneRequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_cloneRequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAccessControlRecord_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAccessControlRecord_Get.cs new file mode 100644 index 000000000000..1cde008f7023 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAccessControlRecord_Get.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified access control record name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleAccessControlRecord_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified access control record name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleAccessControlRecord_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of access control record to be fetched. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of access control record to be fetched.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of access control record to be fetched.", + SerializedName = @"accessControlRecordName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AccessControlRecordName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleAccessControlRecord_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AccessControlRecordsGet(Name, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAccessControlRecord_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAccessControlRecord_GetViaIdentity.cs new file mode 100644 index 000000000000..af0477e654fd --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAccessControlRecord_GetViaIdentity.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified access control record name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleAccessControlRecord_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified access control record name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleAccessControlRecord_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleAccessControlRecord_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AccessControlRecordsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.AccessControlRecordName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccessControlRecordName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AccessControlRecordsGet(InputObject.AccessControlRecordName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAccessControlRecord_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAccessControlRecord_List.cs new file mode 100644 index 000000000000..1dcb4ffe32b7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAccessControlRecord_List.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the access control records in a manager. + /// + /// [OpenAPI] ListByManager=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleAccessControlRecord_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the access control records in a manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleAccessControlRecord_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleAccessControlRecord_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AccessControlRecordsListByManager(SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecordList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAlert_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAlert_List.cs new file mode 100644 index 000000000000..f5281b9bd729 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAlert_List.cs @@ -0,0 +1,439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the alerts in a manager. + /// + /// [OpenAPI] ListByManager=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/alerts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleAlert_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlert))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the alerts in a manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleAlert_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// OData Filter options + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData Filter options")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData Filter options", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleAlert_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsListByManager(SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsListByManager_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAvailableProviderOperation_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAvailableProviderOperation_List.cs new file mode 100644 index 000000000000..1c793f631660 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleAvailableProviderOperation_List.cs @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// List of AvailableProviderOperations + /// + /// [OpenAPI] List=>GET:"/providers/Microsoft.StorSimple/operations" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleAvailableProviderOperation_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"List of AvailableProviderOperations")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleAvailableProviderOperation_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperations + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleAvailableProviderOperation_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AvailableProviderOperationsList(onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAvailableProviderOperations + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AvailableProviderOperationsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackupScheduleGroup_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackupScheduleGroup_Get.cs new file mode 100644 index 000000000000..248a8ae3d1c7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackupScheduleGroup_Get.cs @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified backup schedule group name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleBackupScheduleGroup_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified backup schedule group name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleBackupScheduleGroup_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The name of the device. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the device.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the device.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _scheduleGroupName; + + /// The name of the schedule group. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the schedule group.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the schedule group.", + SerializedName = @"scheduleGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ScheduleGroupName { get => this._scheduleGroupName; set => this._scheduleGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleBackupScheduleGroup_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupScheduleGroupsGet(DeviceName, ScheduleGroupName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,ScheduleGroupName=ScheduleGroupName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ScheduleGroupName=ScheduleGroupName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ScheduleGroupName=ScheduleGroupName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackupScheduleGroup_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackupScheduleGroup_GetViaIdentity.cs new file mode 100644 index 000000000000..17b3454b3957 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackupScheduleGroup_GetViaIdentity.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified backup schedule group name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleBackupScheduleGroup_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified backup schedule group name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleBackupScheduleGroup_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleBackupScheduleGroup_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BackupScheduleGroupsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ScheduleGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ScheduleGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BackupScheduleGroupsGet(InputObject.DeviceName ?? null, InputObject.ScheduleGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackupScheduleGroup_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackupScheduleGroup_List.cs new file mode 100644 index 000000000000..aa3a2bb3c2c1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackupScheduleGroup_List.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the backup schedule groups in a device. + /// + /// [OpenAPI] ListByDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleBackupScheduleGroup_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the backup schedule groups in a device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleBackupScheduleGroup_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The name of the device. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the device.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the device.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleBackupScheduleGroup_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupScheduleGroupsListByDevice(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroupList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackup_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackup_List.cs new file mode 100644 index 000000000000..4af55cbfd391 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackup_List.cs @@ -0,0 +1,439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the backups in a manager. + /// + /// [OpenAPI] ListByManager=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/backups" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleBackup_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the backups in a manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleBackup_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// OData Filter options + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData Filter options")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData Filter options", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleBackup_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupsListByManager(SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupsListByManager_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackup_List1.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackup_List1.cs new file mode 100644 index 000000000000..7ac579121f30 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleBackup_List1.cs @@ -0,0 +1,469 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// + /// Retrieves all the backups in a device. Can be used to get the backups for failover also. + /// + /// + /// [OpenAPI] ListByDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleBackup_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the backups in a device. Can be used to get the backups for failover also.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleBackup_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _filter; + + /// OData Filter options + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData Filter options")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData Filter options", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _forFailover; + + /// Set to true if you need backups which can be used for failover. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to true if you need backups which can be used for failover.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to true if you need backups which can be used for failover.", + SerializedName = @"forFailover", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter ForFailover { get => this._forFailover; set => this._forFailover = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleBackup_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupsListByDevice(DeviceName, this.InvocationInformation.BoundParameters.ContainsKey("ForFailover") ? ForFailover : default(global::System.Management.Automation.SwitchParameter?), SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,ForFailover=this.InvocationInformation.BoundParameters.ContainsKey("ForFailover") ? ForFailover : default(global::System.Management.Automation.SwitchParameter?),SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ForFailover=this.InvocationInformation.BoundParameters.ContainsKey("ForFailover") ? ForFailover : default(global::System.Management.Automation.SwitchParameter?), SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ForFailover=this.InvocationInformation.BoundParameters.ContainsKey("ForFailover") ? ForFailover : default(global::System.Management.Automation.SwitchParameter?), SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupsListByDevice_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleChapSetting_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleChapSetting_Get.cs new file mode 100644 index 000000000000..6e61d2d07efe --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleChapSetting_Get.cs @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified chap setting name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleChapSetting_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified chap setting name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleChapSetting_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Backing field for property. + private string _chapUserName; + + /// The user name of chap to be fetched. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The user name of chap to be fetched.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The user name of chap to be fetched.", + SerializedName = @"chapUserName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ChapUserName { get => this._chapUserName; set => this._chapUserName = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleChapSetting_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ChapSettingsGet(DeviceName, ChapUserName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,ChapUserName=ChapUserName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ChapUserName=ChapUserName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ChapUserName=ChapUserName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleChapSetting_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleChapSetting_GetViaIdentity.cs new file mode 100644 index 000000000000..c4a4a3d20e10 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleChapSetting_GetViaIdentity.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified chap setting name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleChapSetting_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified chap setting name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleChapSetting_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleChapSetting_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ChapSettingsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ChapUserName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ChapUserName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ChapSettingsGet(InputObject.DeviceName ?? null, InputObject.ChapUserName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleChapSetting_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleChapSetting_List.cs new file mode 100644 index 000000000000..ca8edc71ba40 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleChapSetting_List.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the chap settings in a device. + /// + /// [OpenAPI] ListByDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleChapSetting_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the chap settings in a device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleChapSetting_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The name of the device. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the device.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the device.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleChapSetting_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ChapSettingsListByDevice(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettingsList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceAlertSetting_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceAlertSetting_Get.cs new file mode 100644 index 000000000000..bb9a9b1211f0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceAlertSetting_Get.cs @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the alert settings of the specified device name. + /// + /// [OpenAPI] GetAlertSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDeviceAlertSetting_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the alert settings of the specified device name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDeviceAlertSetting_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDeviceAlertSetting_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesGetAlertSettings(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceAlertSetting_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceAlertSetting_GetViaIdentity.cs new file mode 100644 index 000000000000..92d880cd249e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceAlertSetting_GetViaIdentity.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the alert settings of the specified device name. + /// + /// [OpenAPI] GetAlertSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDeviceAlertSetting_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the alert settings of the specified device name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDeviceAlertSetting_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDeviceAlertSetting_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesGetAlertSettingsViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DevicesGetAlertSettings(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceFailoverTarget_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceFailoverTarget_List.cs new file mode 100644 index 000000000000..1bc9ed9e3d01 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceFailoverTarget_List.cs @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// + /// Retrieves all the devices which can be used as failover targets for the given device. + /// + /// + /// [OpenAPI] ListFailoverTarget=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/failoverTargets" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDeviceFailoverTarget_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the devices which can be used as failover targets for the given device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDeviceFailoverTarget_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _expand; + + /// Specify $expand=details to populate additional fields related to the device. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specify $expand=details to populate additional fields related to the device.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify $expand=details to populate additional fields related to the device.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDeviceFailoverTarget_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesListFailoverTarget(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceMetricDefinition_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceMetricDefinition_List.cs new file mode 100644 index 000000000000..b32e1e31df8e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceMetricDefinition_List.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves metric definition of all metrics aggregated at device. + /// + /// [OpenAPI] ListMetricDefinition=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metricsDefinitions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDeviceMetricDefinition_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves metric definition of all metrics aggregated at device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDeviceMetricDefinition_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The name of the appliance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the appliance.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the appliance.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDeviceMetricDefinition_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesListMetricDefinition(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceMetric_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceMetric_List.cs new file mode 100644 index 000000000000..0819cfae5d61 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceMetric_List.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves the device metrics. + /// + /// [OpenAPI] ListMetrics=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metrics" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDeviceMetric_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves the device metrics.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDeviceMetric_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The name of the appliance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the appliance.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the appliance.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _filter; + + /// OData Filter options + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData Filter options")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData Filter options", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDeviceMetric_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesListMetrics(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceNetworkSetting_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceNetworkSetting_Get.cs new file mode 100644 index 000000000000..cc2ccb08c6f1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceNetworkSetting_Get.cs @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the network settings of the specified device name. + /// + /// [OpenAPI] GetNetworkSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/networkSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDeviceNetworkSetting_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the network settings of the specified device name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDeviceNetworkSetting_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDeviceNetworkSetting_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesGetNetworkSettings(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceNetworkSetting_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceNetworkSetting_GetViaIdentity.cs new file mode 100644 index 000000000000..f7e902192a23 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceNetworkSetting_GetViaIdentity.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the network settings of the specified device name. + /// + /// [OpenAPI] GetNetworkSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/networkSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDeviceNetworkSetting_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the network settings of the specified device name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDeviceNetworkSetting_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDeviceNetworkSetting_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesGetNetworkSettingsViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DevicesGetNetworkSettings(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.INetworkSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceTimeSetting_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceTimeSetting_Get.cs new file mode 100644 index 000000000000..dcee40e1a657 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceTimeSetting_Get.cs @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the time settings of the specified device name. + /// + /// [OpenAPI] GetTimeSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/timeSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDeviceTimeSetting_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the time settings of the specified device name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDeviceTimeSetting_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDeviceTimeSetting_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesGetTimeSettings(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceTimeSetting_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceTimeSetting_GetViaIdentity.cs new file mode 100644 index 000000000000..fc43108fff5a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceTimeSetting_GetViaIdentity.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the time settings of the specified device name. + /// + /// [OpenAPI] GetTimeSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/timeSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDeviceTimeSetting_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the time settings of the specified device name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDeviceTimeSetting_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDeviceTimeSetting_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesGetTimeSettingsViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DevicesGetTimeSettings(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ITimeSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceUpdateSummary_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceUpdateSummary_Get.cs new file mode 100644 index 000000000000..4e719192d5aa --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceUpdateSummary_Get.cs @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the update summary of the specified device name. + /// + /// [OpenAPI] GetUpdateSummary=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/updateSummary/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDeviceUpdateSummary_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the update summary of the specified device name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDeviceUpdateSummary_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDeviceUpdateSummary_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesGetUpdateSummary(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceUpdateSummary_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceUpdateSummary_GetViaIdentity.cs new file mode 100644 index 000000000000..1dd529e68fcd --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDeviceUpdateSummary_GetViaIdentity.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the update summary of the specified device name. + /// + /// [OpenAPI] GetUpdateSummary=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/updateSummary/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDeviceUpdateSummary_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the update summary of the specified device name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDeviceUpdateSummary_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDeviceUpdateSummary_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesGetUpdateSummaryViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DevicesGetUpdateSummary(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUpdates + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDevice_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDevice_Get.cs new file mode 100644 index 000000000000..242da714524f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDevice_Get.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified device name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDevice_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified device name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDevice_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Specify $expand=details to populate additional fields related to the device. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specify $expand=details to populate additional fields related to the device.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify $expand=details to populate additional fields related to the device.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DeviceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDevice_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesGet(Name, SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDevice_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDevice_GetViaIdentity.cs new file mode 100644 index 000000000000..17f7b8bb21ed --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDevice_GetViaIdentity.cs @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified device name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDevice_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified device name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDevice_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Specify $expand=details to populate additional fields related to the device. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specify $expand=details to populate additional fields related to the device.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify $expand=details to populate additional fields related to the device.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDevice_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesGetViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DevicesGet(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDevice_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDevice_List.cs new file mode 100644 index 000000000000..876c13abbfc0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleDevice_List.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the devices in a manager. + /// + /// [OpenAPI] ListByManager=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleDevice_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the devices in a manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleDevice_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Specify $expand=details to populate additional fields related to the device. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specify $expand=details to populate additional fields related to the device.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify $expand=details to populate additional fields related to the device.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleDevice_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesListByManager(SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDeviceList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServerMetricDefinition_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServerMetricDefinition_List.cs new file mode 100644 index 000000000000..7dec943c8722 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServerMetricDefinition_List.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves metric definitions of all metrics aggregated at the file server. + /// + /// [OpenAPI] ListMetricDefinition=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/metricsDefinitions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleFileServerMetricDefinition_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves metric definitions of all metrics aggregated at the file server.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleFileServerMetricDefinition_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The name of the device. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the device.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the device.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _fileServerName; + + /// The name of the file server. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the file server.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the file server.", + SerializedName = @"fileServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string FileServerName { get => this._fileServerName; set => this._fileServerName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleFileServerMetricDefinition_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileServersListMetricDefinition(DeviceName, FileServerName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,FileServerName=FileServerName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServerMetric_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServerMetric_List.cs new file mode 100644 index 000000000000..959839e26550 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServerMetric_List.cs @@ -0,0 +1,446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Gets the file server metrics. + /// + /// [OpenAPI] ListMetrics=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/metrics" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleFileServerMetric_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Gets the file server metrics.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleFileServerMetric_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The name of the device. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the device.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the device.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _fileServerName; + + /// The name of the file server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the file server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the file server name.", + SerializedName = @"fileServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string FileServerName { get => this._fileServerName; set => this._fileServerName = value; } + + /// Backing field for property. + private string _filter; + + /// OData Filter options + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData Filter options")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData Filter options", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleFileServerMetric_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileServersListMetrics(DeviceName, FileServerName, SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,FileServerName=FileServerName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServer_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServer_Get.cs new file mode 100644 index 000000000000..15b8225502c3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServer_Get.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified file server name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleFileServer_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified file server name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleFileServer_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The file server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file server name.", + SerializedName = @"fileServerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("FileServerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleFileServer_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileServersGet(DeviceName, Name, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServer_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServer_GetViaIdentity.cs new file mode 100644 index 000000000000..87eb8d72d40c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServer_GetViaIdentity.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified file server name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleFileServer_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified file server name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleFileServer_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleFileServer_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FileServersGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FileServerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FileServerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FileServersGet(InputObject.DeviceName ?? null, InputObject.FileServerName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServer_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServer_List.cs new file mode 100644 index 000000000000..1f23caf4819f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServer_List.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the file servers in a device. + /// + /// [OpenAPI] ListByDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleFileServer_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the file servers in a device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleFileServer_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleFileServer_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileServersListByDevice(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServer_List1.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServer_List1.cs new file mode 100644 index 000000000000..916d3bfdb472 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileServer_List1.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the file servers in a manager. + /// + /// [OpenAPI] ListByManager=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/fileservers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleFileServer_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the file servers in a manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleFileServer_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleFileServer_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileServersListByManager(SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServerList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShareMetricDefinition_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShareMetricDefinition_List.cs new file mode 100644 index 000000000000..08b4439b317e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShareMetricDefinition_List.cs @@ -0,0 +1,446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves metric definitions of all metrics aggregated at the file share. + /// + /// [OpenAPI] ListMetricDefinition=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}/metricsDefinitions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleFileShareMetricDefinition_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves metric definitions of all metrics aggregated at the file share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleFileShareMetricDefinition_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _fileServerName; + + /// The file server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file server name.", + SerializedName = @"fileServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string FileServerName { get => this._fileServerName; set => this._fileServerName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// The file share name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file share name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file share name.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleFileShareMetricDefinition_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesListMetricDefinition(DeviceName, FileServerName, ShareName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,FileServerName=FileServerName,ShareName=ShareName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, ShareName=ShareName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, ShareName=ShareName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShareMetric_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShareMetric_List.cs new file mode 100644 index 000000000000..62ad5849eb41 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShareMetric_List.cs @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Gets the file share metrics + /// + /// [OpenAPI] ListMetrics=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}/metrics" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleFileShareMetric_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Gets the file share metrics")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleFileShareMetric_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _fileServerName; + + /// The file server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file server name.", + SerializedName = @"fileServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string FileServerName { get => this._fileServerName; set => this._fileServerName = value; } + + /// Backing field for property. + private string _filter; + + /// OData Filter options + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData Filter options")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData Filter options", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// The file share name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file share name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file share name.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleFileShareMetric_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesListMetrics(DeviceName, FileServerName, ShareName, SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,FileServerName=FileServerName,ShareName=ShareName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, ShareName=ShareName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, ShareName=ShareName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShare_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShare_Get.cs new file mode 100644 index 000000000000..c66e81684057 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShare_Get.cs @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified file share name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleFileShare_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified file share name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleFileShare_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _fileServerName; + + /// The file server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file server name.", + SerializedName = @"fileServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string FileServerName { get => this._fileServerName; set => this._fileServerName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// The file share name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file share name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file share name.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleFileShare_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesGet(DeviceName, FileServerName, ShareName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,FileServerName=FileServerName,ShareName=ShareName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, ShareName=ShareName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, ShareName=ShareName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShare_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShare_GetViaIdentity.cs new file mode 100644 index 000000000000..1a1bce32bddd --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShare_GetViaIdentity.cs @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified file share name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleFileShare_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified file share name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleFileShare_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleFileShare_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FileSharesGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FileServerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FileServerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ShareName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ShareName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FileSharesGet(InputObject.DeviceName ?? null, InputObject.FileServerName ?? null, InputObject.ShareName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShare_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShare_List.cs new file mode 100644 index 000000000000..a0cdd5c8e62e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShare_List.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the file shares in a file server. + /// + /// [OpenAPI] ListByFileServer=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleFileShare_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the file shares in a file server.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleFileShare_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _fileServerName; + + /// The file server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file server name.", + SerializedName = @"fileServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string FileServerName { get => this._fileServerName; set => this._fileServerName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleFileShare_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesListByFileServer(DeviceName, FileServerName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,FileServerName=FileServerName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShare_List1.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShare_List1.cs new file mode 100644 index 000000000000..9a02156f03f8 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleFileShare_List1.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the file shares in a device. + /// + /// [OpenAPI] ListByDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/shares" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleFileShare_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the file shares in a device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleFileShare_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleFileShare_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesListByDevice(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShareList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDiskMetricDefinition_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDiskMetricDefinition_List.cs new file mode 100644 index 000000000000..fb60c2765b67 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDiskMetricDefinition_List.cs @@ -0,0 +1,446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves metric definitions for all metric aggregated at the iSCSI disk. + /// + /// [OpenAPI] ListMetricDefinition=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}/metricsDefinitions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleIscsiDiskMetricDefinition_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves metric definitions for all metric aggregated at the iSCSI disk.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleIscsiDiskMetricDefinition_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _diskName; + + /// The iSCSI disk name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI disk name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI disk name.", + SerializedName = @"diskName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DiskName { get => this._diskName; set => this._diskName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iscsiServerName; + + /// The iSCSI server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI server name.", + SerializedName = @"iscsiServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string IscsiServerName { get => this._iscsiServerName; set => this._iscsiServerName = value; } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleIscsiDiskMetricDefinition_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiDisksListMetricDefinition(DeviceName, IscsiServerName, DiskName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,IscsiServerName=IscsiServerName,DiskName=DiskName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, DiskName=DiskName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, DiskName=DiskName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDiskMetric_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDiskMetric_List.cs new file mode 100644 index 000000000000..340fe0b10bcb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDiskMetric_List.cs @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Gets the iSCSI disk metrics + /// + /// [OpenAPI] ListMetrics=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}/metrics" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleIscsiDiskMetric_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Gets the iSCSI disk metrics")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleIscsiDiskMetric_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _diskName; + + /// The iSCSI disk name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI disk name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI disk name.", + SerializedName = @"diskName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DiskName { get => this._diskName; set => this._diskName = value; } + + /// Backing field for property. + private string _filter; + + /// OData Filter options + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData Filter options")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData Filter options", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iscsiServerName; + + /// The iSCSI server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI server name.", + SerializedName = @"iscsiServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string IscsiServerName { get => this._iscsiServerName; set => this._iscsiServerName = value; } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleIscsiDiskMetric_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiDisksListMetrics(DeviceName, IscsiServerName, DiskName, SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,IscsiServerName=IscsiServerName,DiskName=DiskName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, DiskName=DiskName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, DiskName=DiskName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDisk_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDisk_Get.cs new file mode 100644 index 000000000000..4bd409e9e2b6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDisk_Get.cs @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified iSCSI disk name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleIscsiDisk_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified iSCSI disk name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleIscsiDisk_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _diskName; + + /// The disk name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The disk name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The disk name.", + SerializedName = @"diskName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DiskName { get => this._diskName; set => this._diskName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iscsiServerName; + + /// The iSCSI server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI server name.", + SerializedName = @"iscsiServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string IscsiServerName { get => this._iscsiServerName; set => this._iscsiServerName = value; } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleIscsiDisk_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiDisksGet(DeviceName, IscsiServerName, DiskName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,IscsiServerName=IscsiServerName,DiskName=DiskName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, DiskName=DiskName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, DiskName=DiskName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDisk_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDisk_GetViaIdentity.cs new file mode 100644 index 000000000000..9a6c47fed38e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDisk_GetViaIdentity.cs @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified iSCSI disk name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleIscsiDisk_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified iSCSI disk name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleIscsiDisk_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleIscsiDisk_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.IscsiDisksGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.IscsiServerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.IscsiServerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DiskName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DiskName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.IscsiDisksGet(InputObject.DeviceName ?? null, InputObject.IscsiServerName ?? null, InputObject.DiskName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDisk_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDisk_List.cs new file mode 100644 index 000000000000..9bbb530a590e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDisk_List.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the iSCSI disks in a device. + /// + /// [OpenAPI] ListByDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/disks" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleIscsiDisk_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the iSCSI disks in a device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleIscsiDisk_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleIscsiDisk_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiDisksListByDevice(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDisk_List1.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDisk_List1.cs new file mode 100644 index 000000000000..76d652b5160b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiDisk_List1.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the disks in a iSCSI server. + /// + /// [OpenAPI] ListByIscsiServer=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleIscsiDisk_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the disks in a iSCSI server.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleIscsiDisk_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iscsiServerName; + + /// The iSCSI server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI server name.", + SerializedName = @"iscsiServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string IscsiServerName { get => this._iscsiServerName; set => this._iscsiServerName = value; } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleIscsiDisk_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiDisksListByIscsiServer(DeviceName, IscsiServerName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,IscsiServerName=IscsiServerName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDiskList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServerMetricDefinition_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServerMetricDefinition_List.cs new file mode 100644 index 000000000000..4bdd49185590 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServerMetricDefinition_List.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves metric definitions for all metrics aggregated at iSCSI server. + /// + /// [OpenAPI] ListMetricDefinition=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/metricsDefinitions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleIscsiServerMetricDefinition_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves metric definitions for all metrics aggregated at iSCSI server.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleIscsiServerMetricDefinition_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iscsiServerName; + + /// The iSCSI server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI server name.", + SerializedName = @"iscsiServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string IscsiServerName { get => this._iscsiServerName; set => this._iscsiServerName = value; } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleIscsiServerMetricDefinition_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiServersListMetricDefinition(DeviceName, IscsiServerName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,IscsiServerName=IscsiServerName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServerMetric_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServerMetric_List.cs new file mode 100644 index 000000000000..268aab4a14ff --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServerMetric_List.cs @@ -0,0 +1,446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Gets the iSCSI server metrics + /// + /// [OpenAPI] ListMetrics=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/metrics" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleIscsiServerMetric_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Gets the iSCSI server metrics")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleIscsiServerMetric_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _filter; + + /// OData Filter options + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData Filter options")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData Filter options", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iscsiServerName; + + /// The iSCSI server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI server name.", + SerializedName = @"iscsiServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string IscsiServerName { get => this._iscsiServerName; set => this._iscsiServerName = value; } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleIscsiServerMetric_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiServersListMetrics(DeviceName, IscsiServerName, SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,IscsiServerName=IscsiServerName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServer_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServer_Get.cs new file mode 100644 index 000000000000..da4fe371dfc6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServer_Get.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified iSCSI server name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleIscsiServer_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified iSCSI server name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleIscsiServer_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The iSCSI server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI server name.", + SerializedName = @"iscsiServerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("IscsiServerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleIscsiServer_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiServersGet(DeviceName, Name, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServer_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServer_GetViaIdentity.cs new file mode 100644 index 000000000000..afe3c74a137d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServer_GetViaIdentity.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified iSCSI server name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleIscsiServer_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified iSCSI server name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleIscsiServer_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleIscsiServer_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.IscsiServersGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.IscsiServerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.IscsiServerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.IscsiServersGet(InputObject.DeviceName ?? null, InputObject.IscsiServerName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServer_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServer_List.cs new file mode 100644 index 000000000000..511a9a4d951e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServer_List.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the iSCSI in a device. + /// + /// [OpenAPI] ListByDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleIscsiServer_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the iSCSI in a device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleIscsiServer_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleIscsiServer_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiServersListByDevice(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServer_List1.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServer_List1.cs new file mode 100644 index 000000000000..f61e9faa5e85 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleIscsiServer_List1.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the iSCSI servers in a manager. + /// + /// [OpenAPI] ListByManager=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/iscsiservers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleIscsiServer_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the iSCSI servers in a manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleIscsiServer_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleIscsiServer_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiServersListByManager(SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServerList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleJob_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleJob_Get.cs new file mode 100644 index 000000000000..b3a5d1e9a5a2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleJob_Get.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified job name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs/{jobName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleJob_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified job name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleJob_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The job name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The job name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The job name.", + SerializedName = @"jobName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("JobName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleJob_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.JobsGet(DeviceName, Name, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleJob_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleJob_GetViaIdentity.cs new file mode 100644 index 000000000000..34c5156b7aa1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleJob_GetViaIdentity.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified job name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs/{jobName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleJob_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified job name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleJob_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleJob_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.JobsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.JobName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.JobName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.JobsGet(InputObject.DeviceName ?? null, InputObject.JobName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleJob_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleJob_List.cs new file mode 100644 index 000000000000..3f84e43ff000 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleJob_List.cs @@ -0,0 +1,453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the jobs in a device. + /// + /// [OpenAPI] ListByDevice=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleJob_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the jobs in a device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleJob_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _filter; + + /// OData Filter options + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData Filter options")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData Filter options", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleJob_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.JobsListByDevice(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.JobsListByDevice_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleJob_List1.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleJob_List1.cs new file mode 100644 index 000000000000..fd7dfd0b646e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleJob_List1.cs @@ -0,0 +1,439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the jobs in a manager. + /// + /// [OpenAPI] ListByManager=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/jobs" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleJob_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJob))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the jobs in a manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleJob_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// OData Filter options + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData Filter options")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData Filter options", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleJob_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.JobsListByManager(SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IJobList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.JobsListByManager_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerEncryptionKey_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerEncryptionKey_Get.cs new file mode 100644 index 000000000000..1ee36aeebc4a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerEncryptionKey_Get.cs @@ -0,0 +1,406 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the symmetric encryption key of the manager. + /// + /// [OpenAPI] GetEncryptionKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/getEncryptionKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleManagerEncryptionKey_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the symmetric encryption key of the manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleManagerEncryptionKey_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleManagerEncryptionKey_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersGetEncryptionKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersGetEncryptionKey(SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerEncryptionKey_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerEncryptionKey_GetViaIdentity.cs new file mode 100644 index 000000000000..907aa32ef6f3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerEncryptionKey_GetViaIdentity.cs @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the symmetric encryption key of the manager. + /// + /// [OpenAPI] GetEncryptionKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/getEncryptionKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleManagerEncryptionKey_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the symmetric encryption key of the manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleManagerEncryptionKey_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleManagerEncryptionKey_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersGetEncryptionKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagersGetEncryptionKeyViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagersGetEncryptionKey(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISymmetricEncryptedSecret + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerEncryptionSetting_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerEncryptionSetting_Get.cs new file mode 100644 index 000000000000..19175000ea33 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerEncryptionSetting_Get.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the encryption settings of the manager. + /// + /// [OpenAPI] GetEncryptionSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/encryptionSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleManagerEncryptionSetting_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the encryption settings of the manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleManagerEncryptionSetting_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleManagerEncryptionSetting_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersGetEncryptionSettings(SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerEncryptionSetting_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerEncryptionSetting_GetViaIdentity.cs new file mode 100644 index 000000000000..b134b300adf3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerEncryptionSetting_GetViaIdentity.cs @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the encryption settings of the manager. + /// + /// [OpenAPI] GetEncryptionSettings=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/encryptionSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleManagerEncryptionSetting_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the encryption settings of the manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleManagerEncryptionSetting_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleManagerEncryptionSetting_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagersGetEncryptionSettingsViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagersGetEncryptionSettings(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IEncryptionSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerExtendedInfo_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerExtendedInfo_Get.cs new file mode 100644 index 000000000000..58e3cb2d4cc6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerExtendedInfo_Get.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the extended information of the specified manager name. + /// + /// [OpenAPI] GetExtendedInfo=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleManagerExtendedInfo_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the extended information of the specified manager name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleManagerExtendedInfo_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleManagerExtendedInfo_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersGetExtendedInfo(SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerExtendedInfo_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerExtendedInfo_GetViaIdentity.cs new file mode 100644 index 000000000000..7f3c0411563a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerExtendedInfo_GetViaIdentity.cs @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the extended information of the specified manager name. + /// + /// [OpenAPI] GetExtendedInfo=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleManagerExtendedInfo_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the extended information of the specified manager name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleManagerExtendedInfo_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleManagerExtendedInfo_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagersGetExtendedInfoViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagersGetExtendedInfo(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerMetricDefinition_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerMetricDefinition_List.cs new file mode 100644 index 000000000000..649e061183fb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerMetricDefinition_List.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves metric definition of all metrics aggregated at manager. + /// + /// [OpenAPI] ListMetricDefinition=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/metricsDefinitions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleManagerMetricDefinition_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinition))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves metric definition of all metrics aggregated at manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleManagerMetricDefinition_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleManagerMetricDefinition_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersListMetricDefinition(SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricDefinitionList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerMetric_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerMetric_List.cs new file mode 100644 index 000000000000..c1d664bd0960 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManagerMetric_List.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Gets the manager metrics + /// + /// [OpenAPI] ListMetrics=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/metrics" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleManagerMetric_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetrics))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Gets the manager metrics")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleManagerMetric_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// OData Filter options + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OData Filter options")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OData Filter options", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleManagerMetric_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersListMetrics(SubscriptionId, ResourceGroupName, ManagerName, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IMetricList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManager_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManager_Get.cs new file mode 100644 index 000000000000..172eac8e49b5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManager_Get.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified manager name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleManager_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified manager name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleManager_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ManagerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleManager_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersGet(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManager_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManager_GetViaIdentity.cs new file mode 100644 index 000000000000..859fb4f95be9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManager_GetViaIdentity.cs @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified manager name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleManager_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified manager name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleManager_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleManager_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagersGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagersGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManager_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManager_List.cs new file mode 100644 index 000000000000..a27f785c19b4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManager_List.cs @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the managers in a subscription. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.StorSimple/managers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleManager_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the managers in a subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleManager_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleManager_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersList(SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManager_List1.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManager_List1.cs new file mode 100644 index 000000000000..6cbac07dab08 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleManager_List1.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the managers in a resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleManager_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the managers in a resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleManager_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleManager_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersListByResourceGroup(SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageAccountCredentials_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageAccountCredentials_Get.cs new file mode 100644 index 000000000000..7a5d1e7b0788 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageAccountCredentials_Get.cs @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified storage account credential name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleStorageAccountCredentials_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified storage account credential name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleStorageAccountCredentials_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _credentialName; + + /// The name of storage account credential to be fetched. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of storage account credential to be fetched.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of storage account credential to be fetched.", + SerializedName = @"credentialName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string CredentialName { get => this._credentialName; set => this._credentialName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleStorageAccountCredentials_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountCredentialsGet(CredentialName, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CredentialName=CredentialName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CredentialName=CredentialName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CredentialName=CredentialName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageAccountCredentials_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageAccountCredentials_GetViaIdentity.cs new file mode 100644 index 000000000000..c61b4b5248a0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageAccountCredentials_GetViaIdentity.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified storage account credential name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleStorageAccountCredentials_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified storage account credential name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleStorageAccountCredentials_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleStorageAccountCredentials_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountCredentialsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.CredentialName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.CredentialName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountCredentialsGet(InputObject.CredentialName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageAccountCredentials_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageAccountCredentials_List.cs new file mode 100644 index 000000000000..85ad6a86ce8c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageAccountCredentials_List.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the storage account credentials in a manager. + /// + /// [OpenAPI] ListByManager=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleStorageAccountCredentials_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the storage account credentials in a manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleStorageAccountCredentials_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleStorageAccountCredentials_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountCredentialsListByManager(SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredentialList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageDomain_Get.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageDomain_Get.cs new file mode 100644 index 000000000000..414617eb0e0e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageDomain_Get.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified storage domain name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleStorageDomain_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified storage domain name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleStorageDomain_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The storage domain name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage domain name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage domain name.", + SerializedName = @"storageDomainName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("StorageDomainName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleStorageDomain_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageDomainsGet(Name, SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageDomain_GetViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageDomain_GetViaIdentity.cs new file mode 100644 index 000000000000..116673d7a15b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageDomain_GetViaIdentity.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Returns the properties of the specified storage domain name. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleStorageDomain_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Returns the properties of the specified storage domain name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleStorageDomain_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleStorageDomain_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageDomainsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.StorageDomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.StorageDomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageDomainsGet(InputObject.StorageDomainName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageDomain_List.cs b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageDomain_List.cs new file mode 100644 index 000000000000..ecd3c784ea46 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/GetAzStorSimpleStorageDomain_List.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Retrieves all the storage domains in a manager. + /// + /// [OpenAPI] ListByManager=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorSimpleStorageDomain_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Retrieves all the storage domains in a manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class GetAzStorSimpleStorageDomain_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorSimpleStorageDomain_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageDomainsListByManager(SubscriptionId, ResourceGroupName, ManagerName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomainList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/InstallAzStorSimpleDeviceUpdate_Install.cs b/swaggerci/storSimple1200Series/generated/cmdlets/InstallAzStorSimpleDeviceUpdate_Install.cs new file mode 100644 index 000000000000..a35767e335e9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/InstallAzStorSimpleDeviceUpdate_Install.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Installs the updates on the device. + /// + /// [OpenAPI] InstallUpdates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/install" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Install, @"AzStorSimpleDeviceUpdate_Install", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Installs the updates on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class InstallAzStorSimpleDeviceUpdate_Install : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of InstallAzStorSimpleDeviceUpdate_Install + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.InstallAzStorSimpleDeviceUpdate_Install Clone() + { + var clone = new InstallAzStorSimpleDeviceUpdate_Install(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InstallAzStorSimpleDeviceUpdate_Install() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesInstallUpdates' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesInstallUpdates(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/InstallAzStorSimpleDeviceUpdate_InstallViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/InstallAzStorSimpleDeviceUpdate_InstallViaIdentity.cs new file mode 100644 index 000000000000..01a23187493f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/InstallAzStorSimpleDeviceUpdate_InstallViaIdentity.cs @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Installs the updates on the device. + /// + /// [OpenAPI] InstallUpdates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/install" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Install, @"AzStorSimpleDeviceUpdate_InstallViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Installs the updates on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class InstallAzStorSimpleDeviceUpdate_InstallViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of InstallAzStorSimpleDeviceUpdate_InstallViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.InstallAzStorSimpleDeviceUpdate_InstallViaIdentity Clone() + { + var clone = new InstallAzStorSimpleDeviceUpdate_InstallViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InstallAzStorSimpleDeviceUpdate_InstallViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesInstallUpdates' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesInstallUpdatesViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DevicesInstallUpdates(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleDeactivateDevice_Deactivate.cs b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleDeactivateDevice_Deactivate.cs new file mode 100644 index 000000000000..4d9de8e3ebd7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleDeactivateDevice_Deactivate.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deactivates the device. + /// + /// [OpenAPI] Deactivate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/deactivate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorSimpleDeactivateDevice_Deactivate", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deactivates the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class InvokeAzStorSimpleDeactivateDevice_Deactivate : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of InvokeAzStorSimpleDeactivateDevice_Deactivate + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.InvokeAzStorSimpleDeactivateDevice_Deactivate Clone() + { + var clone = new InvokeAzStorSimpleDeactivateDevice_Deactivate(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorSimpleDeactivateDevice_Deactivate() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesDeactivate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesDeactivate(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleDeactivateDevice_DeactivateViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleDeactivateDevice_DeactivateViaIdentity.cs new file mode 100644 index 000000000000..e88b57e8b77f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleDeactivateDevice_DeactivateViaIdentity.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deactivates the device. + /// + /// [OpenAPI] Deactivate=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/deactivate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorSimpleDeactivateDevice_DeactivateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deactivates the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class InvokeAzStorSimpleDeactivateDevice_DeactivateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzStorSimpleDeactivateDevice_DeactivateViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.InvokeAzStorSimpleDeactivateDevice_DeactivateViaIdentity Clone() + { + var clone = new InvokeAzStorSimpleDeactivateDevice_DeactivateViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorSimpleDeactivateDevice_DeactivateViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesDeactivate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesDeactivateViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DevicesDeactivate(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleDownloadDeviceUpdate_Download.cs b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleDownloadDeviceUpdate_Download.cs new file mode 100644 index 000000000000..073c3f196358 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleDownloadDeviceUpdate_Download.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Downloads updates on the device. + /// + /// [OpenAPI] DownloadUpdates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/download" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorSimpleDownloadDeviceUpdate_Download", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Downloads updates on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class InvokeAzStorSimpleDownloadDeviceUpdate_Download : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of InvokeAzStorSimpleDownloadDeviceUpdate_Download + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.InvokeAzStorSimpleDownloadDeviceUpdate_Download Clone() + { + var clone = new InvokeAzStorSimpleDownloadDeviceUpdate_Download(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorSimpleDownloadDeviceUpdate_Download() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesDownloadUpdates' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesDownloadUpdates(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleDownloadDeviceUpdate_DownloadViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleDownloadDeviceUpdate_DownloadViaIdentity.cs new file mode 100644 index 000000000000..f6c725862dff --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleDownloadDeviceUpdate_DownloadViaIdentity.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Downloads updates on the device. + /// + /// [OpenAPI] DownloadUpdates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/download" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorSimpleDownloadDeviceUpdate_DownloadViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Downloads updates on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class InvokeAzStorSimpleDownloadDeviceUpdate_DownloadViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzStorSimpleDownloadDeviceUpdate_DownloadViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.InvokeAzStorSimpleDownloadDeviceUpdate_DownloadViaIdentity Clone() + { + var clone = new InvokeAzStorSimpleDownloadDeviceUpdate_DownloadViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorSimpleDownloadDeviceUpdate_DownloadViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesDownloadUpdates' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesDownloadUpdatesViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DevicesDownloadUpdates(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleScanDevice_Scan.cs b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleScanDevice_Scan.cs new file mode 100644 index 000000000000..18d42700b14d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleScanDevice_Scan.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Scans for updates on the device. + /// + /// [OpenAPI] ScanForUpdates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/scanForUpdates" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorSimpleScanDevice_Scan", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Scans for updates on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class InvokeAzStorSimpleScanDevice_Scan : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of InvokeAzStorSimpleScanDevice_Scan + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.InvokeAzStorSimpleScanDevice_Scan Clone() + { + var clone = new InvokeAzStorSimpleScanDevice_Scan(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorSimpleScanDevice_Scan() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesScanForUpdates' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesScanForUpdates(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleScanDevice_ScanViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleScanDevice_ScanViaIdentity.cs new file mode 100644 index 000000000000..7154fc8e751e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleScanDevice_ScanViaIdentity.cs @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Scans for updates on the device. + /// + /// [OpenAPI] ScanForUpdates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/scanForUpdates" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorSimpleScanDevice_ScanViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Scans for updates on the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class InvokeAzStorSimpleScanDevice_ScanViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of InvokeAzStorSimpleScanDevice_ScanViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.InvokeAzStorSimpleScanDevice_ScanViaIdentity Clone() + { + var clone = new InvokeAzStorSimpleScanDevice_ScanViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorSimpleScanDevice_ScanViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesScanForUpdates' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesScanForUpdatesViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DevicesScanForUpdates(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleUploadManagerRegistrationCertificate_Upload.cs b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleUploadManagerRegistrationCertificate_Upload.cs new file mode 100644 index 000000000000..44db5d00cd2a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleUploadManagerRegistrationCertificate_Upload.cs @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse + /// + /// [OpenAPI] UploadRegistrationCertificate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/certificates/{certificateName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorSimpleUploadManagerRegistrationCertificate_Upload", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class InvokeAzStorSimpleUploadManagerRegistrationCertificate_Upload : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Backing field for property. + private string _certificateName; + + /// Certificate Name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Certificate Name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate Name", + SerializedName = @"certificateName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string CertificateName { get => this._certificateName; set => this._certificateName = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest _uploadCertificateRequestrequest; + + /// Upload Certificate Request to IDM + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Upload Certificate Request to IDM", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Upload Certificate Request to IDM", + SerializedName = @"uploadCertificateRequestrequest", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest UploadCertificateRequestrequest { get => this._uploadCertificateRequestrequest; set => this._uploadCertificateRequestrequest = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorSimpleUploadManagerRegistrationCertificate_Upload() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersUploadRegistrationCertificate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersUploadRegistrationCertificate(CertificateName, SubscriptionId, ResourceGroupName, ManagerName, UploadCertificateRequestrequest, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CertificateName=CertificateName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=UploadCertificateRequestrequest}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CertificateName=CertificateName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=UploadCertificateRequestrequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CertificateName=CertificateName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=UploadCertificateRequestrequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadExpanded.cs new file mode 100644 index 000000000000..177c862b82e1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadExpanded.cs @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse + /// + /// [OpenAPI] UploadRegistrationCertificate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/certificates/{certificateName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorSimpleUploadManagerRegistrationCertificate_UploadExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Upload Certificate Request to IDM + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest _uploadCertificateRequestrequestBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UploadCertificateRequest(); + + /// Specify the Authentication type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specify the Authentication type")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify the Authentication type", + SerializedName = @"authType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType AuthType { get => _uploadCertificateRequestrequestBody.AuthType ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType)""); set => _uploadCertificateRequestrequestBody.AuthType = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Gets or sets the base64 encoded certificate raw data string + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Gets or sets the base64 encoded certificate raw data string")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Gets or sets the base64 encoded certificate raw data string", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + public string Certificate { get => _uploadCertificateRequestrequestBody.Certificate ?? null; set => _uploadCertificateRequestrequestBody.Certificate = value; } + + /// Backing field for property. + private string _certificateName; + + /// Certificate Name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Certificate Name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate Name", + SerializedName = @"certificateName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string CertificateName { get => this._certificateName; set => this._certificateName = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersUploadRegistrationCertificate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersUploadRegistrationCertificate(CertificateName, SubscriptionId, ResourceGroupName, ManagerName, _uploadCertificateRequestrequestBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CertificateName=CertificateName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_uploadCertificateRequestrequestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CertificateName=CertificateName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_uploadCertificateRequestrequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CertificateName=CertificateName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_uploadCertificateRequestrequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentity.cs new file mode 100644 index 000000000000..43e578b09a8b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentity.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse + /// + /// [OpenAPI] UploadRegistrationCertificate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/certificates/{certificateName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest _uploadCertificateRequestrequest; + + /// Upload Certificate Request to IDM + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Upload Certificate Request to IDM", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Upload Certificate Request to IDM", + SerializedName = @"uploadCertificateRequestrequest", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest UploadCertificateRequestrequest { get => this._uploadCertificateRequestrequest; set => this._uploadCertificateRequestrequest = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersUploadRegistrationCertificate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagersUploadRegistrationCertificateViaIdentity(InputObject.Id, UploadCertificateRequestrequest, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.CertificateName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.CertificateName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagersUploadRegistrationCertificate(InputObject.CertificateName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, UploadCertificateRequestrequest, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=UploadCertificateRequestrequest}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=UploadCertificateRequestrequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=UploadCertificateRequestrequest }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentityExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentityExpanded.cs new file mode 100644 index 000000000000..b0b285786521 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentityExpanded.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse + /// + /// [OpenAPI] UploadRegistrationCertificate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/certificates/{certificateName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Upload Vault Cred Certificate.\r\nReturns UploadCertificateResponse")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Upload Certificate Request to IDM + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateRequest _uploadCertificateRequestrequestBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.UploadCertificateRequest(); + + /// Specify the Authentication type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specify the Authentication type")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify the Authentication type", + SerializedName = @"authType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType AuthType { get => _uploadCertificateRequestrequestBody.AuthType ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AuthType)""); set => _uploadCertificateRequestrequestBody.AuthType = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Gets or sets the base64 encoded certificate raw data string + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Gets or sets the base64 encoded certificate raw data string")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Gets or sets the base64 encoded certificate raw data string", + SerializedName = @"certificate", + PossibleTypes = new [] { typeof(string) })] + public string Certificate { get => _uploadCertificateRequestrequestBody.Certificate ?? null; set => _uploadCertificateRequestrequestBody.Certificate = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorSimpleUploadManagerRegistrationCertificate_UploadViaIdentityExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersUploadRegistrationCertificate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagersUploadRegistrationCertificateViaIdentity(InputObject.Id, _uploadCertificateRequestrequestBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.CertificateName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.CertificateName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagersUploadRegistrationCertificate(InputObject.CertificateName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, _uploadCertificateRequestrequestBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_uploadCertificateRequestrequestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_uploadCertificateRequestrequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_uploadCertificateRequestrequestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IUploadCertificateResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleAccessControlRecord_CreateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleAccessControlRecord_CreateExpanded.cs new file mode 100644 index 000000000000..50aa87b500b5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleAccessControlRecord_CreateExpanded.cs @@ -0,0 +1,500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or Updates an access control record. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorSimpleAccessControlRecord_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or Updates an access control record.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class NewAzStorSimpleAccessControlRecord_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// The access control record + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord _accessControlRecordBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AccessControlRecord(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The Iscsi initiator name (IQN) + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Iscsi initiator name (IQN)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Iscsi initiator name (IQN)", + SerializedName = @"initiatorName", + PossibleTypes = new [] { typeof(string) })] + public string InitiatorName { get => _accessControlRecordBody.InitiatorName ?? null; set => _accessControlRecordBody.InitiatorName = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the access control record. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the access control record.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the access control record.", + SerializedName = @"accessControlRecordName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AccessControlRecordName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzStorSimpleAccessControlRecord_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.NewAzStorSimpleAccessControlRecord_CreateExpanded Clone() + { + var clone = new NewAzStorSimpleAccessControlRecord_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._accessControlRecordBody = this._accessControlRecordBody; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorSimpleAccessControlRecord_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AccessControlRecordsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AccessControlRecordsCreateOrUpdate(Name, SubscriptionId, ResourceGroupName, ManagerName, _accessControlRecordBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_accessControlRecordBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_accessControlRecordBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_accessControlRecordBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAccessControlRecord + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleBackupScheduleGroup_CreateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleBackupScheduleGroup_CreateExpanded.cs new file mode 100644 index 000000000000..efe6f1483489 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleBackupScheduleGroup_CreateExpanded.cs @@ -0,0 +1,525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or Updates the backup schedule Group. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorSimpleBackupScheduleGroup_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or Updates the backup schedule Group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class NewAzStorSimpleBackupScheduleGroup_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The Backup Schedule Group + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup _scheduleGroupBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.BackupScheduleGroup(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The name of the device. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the device.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the device.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _scheduleGroupName; + + /// The name of the schedule group. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the schedule group.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the schedule group.", + SerializedName = @"scheduleGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ScheduleGroupName { get => this._scheduleGroupName; set => this._scheduleGroupName = value; } + + /// The hour. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The hour.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The hour.", + SerializedName = @"hour", + PossibleTypes = new [] { typeof(int) })] + public int StartTimeHour { get => _scheduleGroupBody.StartTimeHour; set => _scheduleGroupBody.StartTimeHour = value; } + + /// The minute. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The minute.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The minute.", + SerializedName = @"minute", + PossibleTypes = new [] { typeof(int) })] + public int StartTimeMinute { get => _scheduleGroupBody.StartTimeMinute; set => _scheduleGroupBody.StartTimeMinute = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzStorSimpleBackupScheduleGroup_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.NewAzStorSimpleBackupScheduleGroup_CreateExpanded Clone() + { + var clone = new NewAzStorSimpleBackupScheduleGroup_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._scheduleGroupBody = this._scheduleGroupBody; + clone.DeviceName = this.DeviceName; + clone.ScheduleGroupName = this.ScheduleGroupName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorSimpleBackupScheduleGroup_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupScheduleGroupsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupScheduleGroupsCreateOrUpdate(DeviceName, ScheduleGroupName, SubscriptionId, ResourceGroupName, ManagerName, _scheduleGroupBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,ScheduleGroupName=ScheduleGroupName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_scheduleGroupBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ScheduleGroupName=ScheduleGroupName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_scheduleGroupBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ScheduleGroupName=ScheduleGroupName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_scheduleGroupBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IBackupScheduleGroup + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleChapSetting_CreateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleChapSetting_CreateExpanded.cs new file mode 100644 index 000000000000..db8fc23b9c10 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleChapSetting_CreateExpanded.cs @@ -0,0 +1,540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or updates the chap setting. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorSimpleChapSetting_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or updates the chap setting.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class NewAzStorSimpleChapSetting_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Challenge-Handshake Authentication Protocol (CHAP) setting + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings _chapSettingBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ChapSettings(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Backing field for property. + private string _chapUserName; + + /// The chap user name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The chap user name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The chap user name.", + SerializedName = @"chapUserName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ChapUserName { get => this._chapUserName; set => this._chapUserName = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Algorithm used to encrypt "Value" + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Algorithm used to encrypt \"Value\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm PasswordEncryptionAlgorithm { get => _chapSettingBody.PasswordEncryptionAlgorithm; set => _chapSettingBody.PasswordEncryptionAlgorithm = value; } + + /// Thumbprint certificate that was used to encrypt "Value" + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Thumbprint certificate that was used to encrypt \"Value\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string PasswordEncryptionCertificateThumbprint { get => _chapSettingBody.PasswordEncryptionCertificateThumbprint ?? null; set => _chapSettingBody.PasswordEncryptionCertificateThumbprint = value; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + public string PasswordValue { get => _chapSettingBody.PasswordValue ?? null; set => _chapSettingBody.PasswordValue = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzStorSimpleChapSetting_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.NewAzStorSimpleChapSetting_CreateExpanded Clone() + { + var clone = new NewAzStorSimpleChapSetting_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._chapSettingBody = this._chapSettingBody; + clone.DeviceName = this.DeviceName; + clone.ChapUserName = this.ChapUserName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorSimpleChapSetting_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ChapSettingsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ChapSettingsCreateOrUpdate(DeviceName, ChapUserName, SubscriptionId, ResourceGroupName, ManagerName, _chapSettingBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,ChapUserName=ChapUserName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_chapSettingBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ChapUserName=ChapUserName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_chapSettingBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ChapUserName=ChapUserName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_chapSettingBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IChapSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleDeviceAlertSetting_CreateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleDeviceAlertSetting_CreateExpanded.cs new file mode 100644 index 000000000000..0f31b15d6ab8 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleDeviceAlertSetting_CreateExpanded.cs @@ -0,0 +1,542 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or updates the alert settings + /// + /// [OpenAPI] CreateOrUpdateAlertSettings=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorSimpleDeviceAlertSetting_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or updates the alert settings")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class NewAzStorSimpleDeviceAlertSetting_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// AlertSettings on the device which represents how alerts will be processed + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings _alertSettingsBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.AlertSettings(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of email addresses (apart from admin/co-admin of subscription) to whom the alert emails need to be sent", + SerializedName = @"additionalRecipientEmailList", + PossibleTypes = new [] { typeof(string) })] + public string[] AdditionalRecipientEmailList { get => _alertSettingsBody.AdditionalRecipientEmailList ?? null /* arrayOf */; set => _alertSettingsBody.AdditionalRecipientEmailList = value; } + + /// Culture setting to be used while building alert emails. For eg: "en-US" + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Culture setting to be used while building alert emails. For eg: \"en-US\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Culture setting to be used while building alert emails. For eg: ""en-US""", + SerializedName = @"alertNotificationCulture", + PossibleTypes = new [] { typeof(string) })] + public string AlertNotificationCulture { get => _alertSettingsBody.AlertNotificationCulture ?? null; set => _alertSettingsBody.AlertNotificationCulture = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// + /// Value indicating whether user/admins will receive emails when an alert condition occurs on the system + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Value indicating whether user/admins will receive emails when an alert condition occurs on the system")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Value indicating whether user/admins will receive emails when an alert condition occurs on the system", + SerializedName = @"emailNotification", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.AlertEmailNotificationStatus EmailNotification { get => _alertSettingsBody.EmailNotification; set => _alertSettingsBody.EmailNotification = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only + /// if emailNotification flag is Enabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only if emailNotification flag is Enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Value indicating whether service owners will receive emails when an alert condition occurs on the system. Applicable only if emailNotification flag is Enabled.", + SerializedName = @"notificationToServiceOwners", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ServiceOwnersAlertNotificationStatus NotificationToServiceOwner { get => _alertSettingsBody.NotificationToServiceOwner; set => _alertSettingsBody.NotificationToServiceOwner = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzStorSimpleDeviceAlertSetting_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.NewAzStorSimpleDeviceAlertSetting_CreateExpanded Clone() + { + var clone = new NewAzStorSimpleDeviceAlertSetting_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._alertSettingsBody = this._alertSettingsBody; + clone.DeviceName = this.DeviceName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorSimpleDeviceAlertSetting_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesCreateOrUpdateAlertSettings' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesCreateOrUpdateAlertSettings(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, _alertSettingsBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_alertSettingsBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_alertSettingsBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_alertSettingsBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IAlertSettings + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleDeviceSecuritySetting_CreateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleDeviceSecuritySetting_CreateExpanded.cs new file mode 100644 index 000000000000..b4456d0b7f32 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleDeviceSecuritySetting_CreateExpanded.cs @@ -0,0 +1,530 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or updates the security settings. + /// + /// [OpenAPI] CreateOrUpdateSecuritySettings=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/securitySettings/default/update" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorSimpleDeviceSecuritySetting_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or updates the security settings.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class NewAzStorSimpleDeviceSecuritySetting_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The SecuritySettings of a device + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings _securitySettingsBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SecuritySettings(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Algorithm used to encrypt "Value" + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Algorithm used to encrypt \"Value\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get => _securitySettingsBody.DeviceAdminPasswordEncryptionAlgorithm; set => _securitySettingsBody.DeviceAdminPasswordEncryptionAlgorithm = value; } + + /// Thumbprint certificate that was used to encrypt "Value" + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Thumbprint certificate that was used to encrypt \"Value\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string DeviceAdminPasswordEncryptionCertificateThumbprint { get => _securitySettingsBody.DeviceAdminPasswordEncryptionCertificateThumbprint ?? null; set => _securitySettingsBody.DeviceAdminPasswordEncryptionCertificateThumbprint = value; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + public string DeviceAdminPasswordValue { get => _securitySettingsBody.DeviceAdminPasswordValue ?? null; set => _securitySettingsBody.DeviceAdminPasswordValue = value; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzStorSimpleDeviceSecuritySetting_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.NewAzStorSimpleDeviceSecuritySetting_CreateExpanded Clone() + { + var clone = new NewAzStorSimpleDeviceSecuritySetting_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._securitySettingsBody = this._securitySettingsBody; + clone.DeviceName = this.DeviceName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorSimpleDeviceSecuritySetting_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesCreateOrUpdateSecuritySettings' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesCreateOrUpdateSecuritySettings(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, _securitySettingsBody, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_securitySettingsBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_securitySettingsBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_securitySettingsBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleFileServer_CreateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleFileServer_CreateExpanded.cs new file mode 100644 index 000000000000..9c90ddf7359d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleFileServer_CreateExpanded.cs @@ -0,0 +1,548 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or updates the file server. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorSimpleFileServer_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or updates the file server.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class NewAzStorSimpleFileServer_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The file server. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer _fileServerBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileServer(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// The backup policy id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The backup policy id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup policy id.", + SerializedName = @"backupScheduleGroupId", + PossibleTypes = new [] { typeof(string) })] + public string BackupScheduleGroupId { get => _fileServerBody.BackupScheduleGroupId ?? null; set => _fileServerBody.BackupScheduleGroupId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The description of the file server + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The description of the file server")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description of the file server", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => _fileServerBody.Description ?? null; set => _fileServerBody.Description = value; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Domain of the file server + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Domain of the file server")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Domain of the file server", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + public string DomainName { get => _fileServerBody.DomainName ?? null; set => _fileServerBody.DomainName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The file server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file server name.", + SerializedName = @"fileServerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("FileServerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// The storage domain id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage domain id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage domain id.", + SerializedName = @"storageDomainId", + PossibleTypes = new [] { typeof(string) })] + public string StorageDomainId { get => _fileServerBody.StorageDomainId ?? null; set => _fileServerBody.StorageDomainId = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzStorSimpleFileServer_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.NewAzStorSimpleFileServer_CreateExpanded Clone() + { + var clone = new NewAzStorSimpleFileServer_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._fileServerBody = this._fileServerBody; + clone.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorSimpleFileServer_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileServersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileServersCreateOrUpdate(DeviceName, Name, SubscriptionId, ResourceGroupName, ManagerName, _fileServerBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_fileServerBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_fileServerBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_fileServerBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileServer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleFileShare_CreateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleFileShare_CreateExpanded.cs new file mode 100644 index 000000000000..28f5927a7507 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleFileShare_CreateExpanded.cs @@ -0,0 +1,590 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or updates the file share. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorSimpleFileShare_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or updates the file share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class NewAzStorSimpleFileShare_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The File Share. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare _fileShareBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.FileShare(); + + /// + /// The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or + /// Contoso\xyz. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\\xyz.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The user/group who will have full permission in this share. Active directory email address. Example: xyz@contoso.com or Contoso\xyz.", + SerializedName = @"adminUser", + PossibleTypes = new [] { typeof(string) })] + public string AdminUser { get => _fileShareBody.AdminUser ?? null; set => _fileShareBody.AdminUser = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// The data policy + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The data policy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The data policy", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get => _fileShareBody.DataPolicy; set => _fileShareBody.DataPolicy = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Description for file share + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Description for file share")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description for file share", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => _fileShareBody.Description ?? null; set => _fileShareBody.Description = value; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _fileServerName; + + /// The file server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file server name.", + SerializedName = @"fileServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string FileServerName { get => this._fileServerName; set => this._fileServerName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The monitoring status + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The monitoring status")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The monitoring status", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get => _fileShareBody.MonitoringStatus; set => _fileShareBody.MonitoringStatus = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The total provisioned capacity in Bytes + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The total provisioned capacity in Bytes")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The total provisioned capacity in Bytes", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + public long ProvisionedCapacityInByte { get => _fileShareBody.ProvisionedCapacityInByte; set => _fileShareBody.ProvisionedCapacityInByte = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// The file share name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file share name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file share name.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// The Share Status + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Share Status")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Share Status", + SerializedName = @"shareStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ShareStatus ShareStatus { get => _fileShareBody.ShareStatus; set => _fileShareBody.ShareStatus = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzStorSimpleFileShare_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.NewAzStorSimpleFileShare_CreateExpanded Clone() + { + var clone = new NewAzStorSimpleFileShare_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._fileShareBody = this._fileShareBody; + clone.DeviceName = this.DeviceName; + clone.FileServerName = this.FileServerName; + clone.ShareName = this.ShareName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorSimpleFileShare_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesCreateOrUpdate(DeviceName, FileServerName, ShareName, SubscriptionId, ResourceGroupName, ManagerName, _fileShareBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,FileServerName=FileServerName,ShareName=ShareName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_fileShareBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, ShareName=ShareName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_fileShareBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, ShareName=ShareName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_fileShareBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IFileShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleIscsiDisk_CreateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleIscsiDisk_CreateExpanded.cs new file mode 100644 index 000000000000..9fd72b3f523c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleIscsiDisk_CreateExpanded.cs @@ -0,0 +1,588 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or updates the iSCSI disk. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorSimpleIscsiDisk_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or updates the iSCSI disk.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class NewAzStorSimpleIscsiDisk_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The iSCSI disk. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk _iscsiDiskBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiDisk(); + + /// The access control records. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The access control records.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The access control records.", + SerializedName = @"accessControlRecords", + PossibleTypes = new [] { typeof(string) })] + public string[] AccessControlRecord { get => _iscsiDiskBody.AccessControlRecord ?? null /* arrayOf */; set => _iscsiDiskBody.AccessControlRecord = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// The data policy. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The data policy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The data policy.", + SerializedName = @"dataPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DataPolicy DataPolicy { get => _iscsiDiskBody.DataPolicy; set => _iscsiDiskBody.DataPolicy = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The description. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The description.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => _iscsiDiskBody.Description ?? null; set => _iscsiDiskBody.Description = value; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _diskName; + + /// The disk name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The disk name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The disk name.", + SerializedName = @"diskName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DiskName { get => this._diskName; set => this._diskName = value; } + + /// The disk status. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The disk status.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The disk status.", + SerializedName = @"diskStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.DiskStatus DiskStatus { get => _iscsiDiskBody.DiskStatus; set => _iscsiDiskBody.DiskStatus = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iscsiServerName; + + /// The iSCSI server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI server name.", + SerializedName = @"iscsiServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string IscsiServerName { get => this._iscsiServerName; set => this._iscsiServerName = value; } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The monitoring. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The monitoring.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The monitoring.", + SerializedName = @"monitoringStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.MonitoringStatus MonitoringStatus { get => _iscsiDiskBody.MonitoringStatus; set => _iscsiDiskBody.MonitoringStatus = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The provisioned capacity in bytes. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The provisioned capacity in bytes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The provisioned capacity in bytes.", + SerializedName = @"provisionedCapacityInBytes", + PossibleTypes = new [] { typeof(long) })] + public long ProvisionedCapacityInByte { get => _iscsiDiskBody.ProvisionedCapacityInByte; set => _iscsiDiskBody.ProvisionedCapacityInByte = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzStorSimpleIscsiDisk_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.NewAzStorSimpleIscsiDisk_CreateExpanded Clone() + { + var clone = new NewAzStorSimpleIscsiDisk_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._iscsiDiskBody = this._iscsiDiskBody; + clone.DeviceName = this.DeviceName; + clone.IscsiServerName = this.IscsiServerName; + clone.DiskName = this.DiskName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorSimpleIscsiDisk_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IscsiDisksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiDisksCreateOrUpdate(DeviceName, IscsiServerName, DiskName, SubscriptionId, ResourceGroupName, ManagerName, _iscsiDiskBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,IscsiServerName=IscsiServerName,DiskName=DiskName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_iscsiDiskBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, DiskName=DiskName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_iscsiDiskBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, DiskName=DiskName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_iscsiDiskBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiDisk + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleIscsiServer_CreateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleIscsiServer_CreateExpanded.cs new file mode 100644 index 000000000000..6213ed1c1eec --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleIscsiServer_CreateExpanded.cs @@ -0,0 +1,559 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or updates the iSCSI server. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorSimpleIscsiServer_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or updates the iSCSI server.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class NewAzStorSimpleIscsiServer_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The iSCSI server. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer _iscsiServerBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IscsiServer(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// The backup policy id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The backup policy id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup policy id.", + SerializedName = @"backupScheduleGroupId", + PossibleTypes = new [] { typeof(string) })] + public string BackupScheduleGroupId { get => _iscsiServerBody.BackupScheduleGroupId ?? null; set => _iscsiServerBody.BackupScheduleGroupId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The chap id. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The chap id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The chap id.", + SerializedName = @"chapId", + PossibleTypes = new [] { typeof(string) })] + public string ChapId { get => _iscsiServerBody.ChapId ?? null; set => _iscsiServerBody.ChapId = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The description. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The description.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => _iscsiServerBody.Description ?? null; set => _iscsiServerBody.Description = value; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The iSCSI server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI server name.", + SerializedName = @"iscsiServerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("IscsiServerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// The reverse chap id. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The reverse chap id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reverse chap id.", + SerializedName = @"reverseChapId", + PossibleTypes = new [] { typeof(string) })] + public string ReverseChapId { get => _iscsiServerBody.ReverseChapId ?? null; set => _iscsiServerBody.ReverseChapId = value; } + + /// The storage domain id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage domain id.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage domain id.", + SerializedName = @"storageDomainId", + PossibleTypes = new [] { typeof(string) })] + public string StorageDomainId { get => _iscsiServerBody.StorageDomainId ?? null; set => _iscsiServerBody.StorageDomainId = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzStorSimpleIscsiServer_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.NewAzStorSimpleIscsiServer_CreateExpanded Clone() + { + var clone = new NewAzStorSimpleIscsiServer_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._iscsiServerBody = this._iscsiServerBody; + clone.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorSimpleIscsiServer_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IscsiServersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiServersCreateOrUpdate(DeviceName, Name, SubscriptionId, ResourceGroupName, ManagerName, _iscsiServerBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_iscsiServerBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_iscsiServerBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_iscsiServerBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IIscsiServer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleManagerExtendedInfo_CreateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleManagerExtendedInfo_CreateExpanded.cs new file mode 100644 index 000000000000..ed58649b6f30 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleManagerExtendedInfo_CreateExpanded.cs @@ -0,0 +1,488 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates the extended info of the manager. + /// + /// [OpenAPI] CreateExtendedInfo=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorSimpleManagerExtendedInfo_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates the extended info of the manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class NewAzStorSimpleManagerExtendedInfo_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The extended info of the manager. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo _managerExtendedInfoBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfo(); + + /// + /// Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. + /// AlgorithmName - if encryption is used + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. AlgorithmName - if encryption is used")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. AlgorithmName - if encryption is used", + SerializedName = @"algorithm", + PossibleTypes = new [] { typeof(string) })] + public string Algorithm { get => _managerExtendedInfoBody.Algorithm ?? null; set => _managerExtendedInfoBody.Algorithm = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Represents the CEK of the resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Represents the CEK of the resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the CEK of the resource", + SerializedName = @"encryptionKey", + PossibleTypes = new [] { typeof(string) })] + public string EncryptionKey { get => _managerExtendedInfoBody.EncryptionKey ?? null; set => _managerExtendedInfoBody.EncryptionKey = value; } + + /// Represents the Cert thumbprint that was used to encrypt the CEK + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Represents the Cert thumbprint that was used to encrypt the CEK")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the Cert thumbprint that was used to encrypt the CEK", + SerializedName = @"encryptionKeyThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string EncryptionKeyThumbprint { get => _managerExtendedInfoBody.EncryptionKeyThumbprint ?? null; set => _managerExtendedInfoBody.EncryptionKeyThumbprint = value; } + + /// ETag of the Resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ETag of the Resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ETag of the Resource", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _managerExtendedInfoBody.Etag ?? null; set => _managerExtendedInfoBody.Etag = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Represents the CIK of the resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Represents the CIK of the resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Represents the CIK of the resource", + SerializedName = @"integrityKey", + PossibleTypes = new [] { typeof(string) })] + public string IntegrityKey { get => _managerExtendedInfoBody.IntegrityKey ?? null; set => _managerExtendedInfoBody.IntegrityKey = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it.", + SerializedName = @"portalCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string PortalCertificateThumbprint { get => _managerExtendedInfoBody.PortalCertificateThumbprint ?? null; set => _managerExtendedInfoBody.PortalCertificateThumbprint = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Represents the version of the ExtendedInfo object being persisted + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Represents the version of the ExtendedInfo object being persisted")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the version of the ExtendedInfo object being persisted", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + public string Version { get => _managerExtendedInfoBody.Version ?? null; set => _managerExtendedInfoBody.Version = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorSimpleManagerExtendedInfo_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersCreateExtendedInfo' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersCreateExtendedInfo(SubscriptionId, ResourceGroupName, ManagerName, _managerExtendedInfoBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_managerExtendedInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_managerExtendedInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_managerExtendedInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleManager_CreateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleManager_CreateExpanded.cs new file mode 100644 index 000000000000..af99d5722d43 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleManager_CreateExpanded.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or updates the manager. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorSimpleManager_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or updates the manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class NewAzStorSimpleManager_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The StorSimple Manager + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager _managerBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.Manager(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Refers to the type of the StorSimple Manager + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Refers to the type of the StorSimple Manager")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Refers to the type of the StorSimple Manager", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType CiIntrinsicSettingType { get => _managerBody.CiIntrinsicSettingType ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.ManagerType)""); set => _managerBody.CiIntrinsicSettingType = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// ETag of the Manager + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ETag of the Manager")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ETag of the Manager", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _managerBody.Etag ?? null; set => _managerBody.Etag = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The Geo location of the Manager + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Geo location of the Manager")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Geo location of the Manager", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _managerBody.Location ?? null; set => _managerBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ManagerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Tags attached to the Manager + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tags attached to the Manager")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tags attached to the Manager", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IResourceTags Tag { get => _managerBody.Tag ?? null /* object */; set => _managerBody.Tag = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorSimpleManager_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _managerBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=_managerBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_managerBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_managerBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleStorageAccountCredentials_CreateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleStorageAccountCredentials_CreateExpanded.cs new file mode 100644 index 000000000000..3c0784291802 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleStorageAccountCredentials_CreateExpanded.cs @@ -0,0 +1,582 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or updates the storage account credential + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorSimpleStorageAccountCredentials_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or updates the storage account credential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class NewAzStorSimpleStorageAccountCredentials_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The storage account credential + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential _storageAccountBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageAccountCredential(); + + /// Algorithm used to encrypt "Value" + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Algorithm used to encrypt \"Value\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm AccessKeyEncryptionAlgorithm { get => _storageAccountBody.AccessKeyEncryptionAlgorithm ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm)""); set => _storageAccountBody.AccessKeyEncryptionAlgorithm = value; } + + /// Thumbprint certificate that was used to encrypt "Value" + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Thumbprint certificate that was used to encrypt \"Value\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string AccessKeyEncryptionCertificateThumbprint { get => _storageAccountBody.AccessKeyEncryptionCertificateThumbprint ?? null; set => _storageAccountBody.AccessKeyEncryptionCertificateThumbprint = value; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + public string AccessKeyValue { get => _storageAccountBody.AccessKeyValue ?? null; set => _storageAccountBody.AccessKeyValue = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// The cloud service provider + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The cloud service provider")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The cloud service provider", + SerializedName = @"cloudType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.CloudType CloudType { get => _storageAccountBody.CloudType; set => _storageAccountBody.CloudType = value; } + + /// Backing field for property. + private string _credentialName; + + /// The credential name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The credential name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The credential name.", + SerializedName = @"credentialName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string CredentialName { get => this._credentialName; set => this._credentialName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SSL needs to be enabled or not + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "SSL needs to be enabled or not")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"SSL needs to be enabled or not", + SerializedName = @"enableSSL", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.SslStatus EnableSsl { get => _storageAccountBody.EnableSsl; set => _storageAccountBody.EnableSsl = value; } + + /// The storage endpoint + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage endpoint")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage endpoint", + SerializedName = @"endPoint", + PossibleTypes = new [] { typeof(string) })] + public string EndPoint { get => _storageAccountBody.EndPoint ?? null; set => _storageAccountBody.EndPoint = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The storage account's geo location + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The storage account's geo location")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The storage account's geo location", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _storageAccountBody.Location ?? null; set => _storageAccountBody.Location = value; } + + /// The storage account login + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage account login")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account login", + SerializedName = @"login", + PossibleTypes = new [] { typeof(string) })] + public string Login { get => _storageAccountBody.Login ?? null; set => _storageAccountBody.Login = value; } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzStorSimpleStorageAccountCredentials_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.NewAzStorSimpleStorageAccountCredentials_CreateExpanded Clone() + { + var clone = new NewAzStorSimpleStorageAccountCredentials_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._storageAccountBody = this._storageAccountBody; + clone.CredentialName = this.CredentialName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorSimpleStorageAccountCredentials_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountCredentialsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountCredentialsCreateOrUpdate(CredentialName, SubscriptionId, ResourceGroupName, ManagerName, _storageAccountBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CredentialName=CredentialName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_storageAccountBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CredentialName=CredentialName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_storageAccountBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CredentialName=CredentialName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_storageAccountBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageAccountCredential + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleStorageDomain_CreateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleStorageDomain_CreateExpanded.cs new file mode 100644 index 000000000000..4d3aab57c595 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/NewAzStorSimpleStorageDomain_CreateExpanded.cs @@ -0,0 +1,550 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or updates the storage domain. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorSimpleStorageDomain_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or updates the storage domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class NewAzStorSimpleStorageDomain_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The storage domain. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain _storageDomainBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.StorageDomain(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Algorithm used to encrypt "Value" + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Algorithm used to encrypt \"Value\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm EncryptionKeyEncryptionAlgorithm { get => _storageDomainBody.EncryptionKeyEncryptionAlgorithm ?? ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm)""); set => _storageDomainBody.EncryptionKeyEncryptionAlgorithm = value; } + + /// Thumbprint certificate that was used to encrypt "Value" + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Thumbprint certificate that was used to encrypt \"Value\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string EncryptionKeyEncryptionCertificateThumbprint { get => _storageDomainBody.EncryptionKeyEncryptionCertificateThumbprint ?? null; set => _storageDomainBody.EncryptionKeyEncryptionCertificateThumbprint = value; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + public string EncryptionKeyValue { get => _storageDomainBody.EncryptionKeyValue ?? null; set => _storageDomainBody.EncryptionKeyValue = value; } + + /// The encryption status "Enabled | Disabled". + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The encryption status \"Enabled | Disabled\".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The encryption status ""Enabled | Disabled"".", + SerializedName = @"encryptionStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionStatus EncryptionStatus { get => _storageDomainBody.EncryptionStatus; set => _storageDomainBody.EncryptionStatus = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The storage domain name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage domain name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage domain name.", + SerializedName = @"storageDomainName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("StorageDomainName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// The storage account credentials. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage account credentials.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account credentials.", + SerializedName = @"storageAccountCredentialIds", + PossibleTypes = new [] { typeof(string) })] + public string[] StorageAccountCredentialId { get => _storageDomainBody.StorageAccountCredentialId ?? null /* arrayOf */; set => _storageDomainBody.StorageAccountCredentialId = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzStorSimpleStorageDomain_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.NewAzStorSimpleStorageDomain_CreateExpanded Clone() + { + var clone = new NewAzStorSimpleStorageDomain_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._storageDomainBody = this._storageDomainBody; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorSimpleStorageDomain_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageDomainsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageDomainsCreateOrUpdate(Name, SubscriptionId, ResourceGroupName, ManagerName, _storageDomainBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_storageDomainBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_storageDomainBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_storageDomainBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IStorageDomain + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleAccessControlRecord_Delete.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleAccessControlRecord_Delete.cs new file mode 100644 index 000000000000..39ea3bf038d5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleAccessControlRecord_Delete.cs @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the access control record. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleAccessControlRecord_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the access control record.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleAccessControlRecord_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the access control record to delete. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the access control record to delete.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the access control record to delete.", + SerializedName = @"accessControlRecordName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AccessControlRecordName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleAccessControlRecord_Delete + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleAccessControlRecord_Delete Clone() + { + var clone = new RemoveAzStorSimpleAccessControlRecord_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AccessControlRecordsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AccessControlRecordsDelete(Name, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleAccessControlRecord_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleAccessControlRecord_DeleteViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleAccessControlRecord_DeleteViaIdentity.cs new file mode 100644 index 000000000000..79674ffc59bb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleAccessControlRecord_DeleteViaIdentity.cs @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the access control record. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleAccessControlRecord_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the access control record.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleAccessControlRecord_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleAccessControlRecord_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleAccessControlRecord_DeleteViaIdentity Clone() + { + var clone = new RemoveAzStorSimpleAccessControlRecord_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AccessControlRecordsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AccessControlRecordsDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.AccessControlRecordName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccessControlRecordName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AccessControlRecordsDelete(InputObject.AccessControlRecordName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleAccessControlRecord_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleBackupScheduleGroup_Delete.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleBackupScheduleGroup_Delete.cs new file mode 100644 index 000000000000..148195177cfc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleBackupScheduleGroup_Delete.cs @@ -0,0 +1,504 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the backup schedule group. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleBackupScheduleGroup_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the backup schedule group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleBackupScheduleGroup_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The name of the device. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the device.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the device.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _scheduleGroupName; + + /// The name of the schedule group. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the schedule group.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the schedule group.", + SerializedName = @"scheduleGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ScheduleGroupName { get => this._scheduleGroupName; set => this._scheduleGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleBackupScheduleGroup_Delete + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleBackupScheduleGroup_Delete Clone() + { + var clone = new RemoveAzStorSimpleBackupScheduleGroup_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.ScheduleGroupName = this.ScheduleGroupName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupScheduleGroupsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupScheduleGroupsDelete(DeviceName, ScheduleGroupName, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,ScheduleGroupName=ScheduleGroupName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleBackupScheduleGroup_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ScheduleGroupName=ScheduleGroupName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ScheduleGroupName=ScheduleGroupName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleBackupScheduleGroup_DeleteViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleBackupScheduleGroup_DeleteViaIdentity.cs new file mode 100644 index 000000000000..daab86c2e81f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleBackupScheduleGroup_DeleteViaIdentity.cs @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the backup schedule group. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleBackupScheduleGroup_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the backup schedule group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleBackupScheduleGroup_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleBackupScheduleGroup_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleBackupScheduleGroup_DeleteViaIdentity Clone() + { + var clone = new RemoveAzStorSimpleBackupScheduleGroup_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupScheduleGroupsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BackupScheduleGroupsDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ScheduleGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ScheduleGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BackupScheduleGroupsDelete(InputObject.DeviceName ?? null, InputObject.ScheduleGroupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleBackupScheduleGroup_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleBackup_Delete.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleBackup_Delete.cs new file mode 100644 index 000000000000..758926685f72 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleBackup_Delete.cs @@ -0,0 +1,505 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the backup. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleBackup_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the backup.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleBackup_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The backup name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The backup name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The backup name.", + SerializedName = @"backupName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BackupName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleBackup_Delete + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleBackup_Delete Clone() + { + var clone = new RemoveAzStorSimpleBackup_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BackupsDelete(DeviceName, Name, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleBackup_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleBackup_DeleteViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleBackup_DeleteViaIdentity.cs new file mode 100644 index 000000000000..0996001d2601 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleBackup_DeleteViaIdentity.cs @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the backup. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleBackup_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the backup.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleBackup_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleBackup_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleBackup_DeleteViaIdentity Clone() + { + var clone = new RemoveAzStorSimpleBackup_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BackupsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BackupsDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.BackupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BackupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BackupsDelete(InputObject.DeviceName ?? null, InputObject.BackupName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleBackup_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleChapSetting_Delete.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleChapSetting_Delete.cs new file mode 100644 index 000000000000..07157d544118 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleChapSetting_Delete.cs @@ -0,0 +1,504 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the chap setting. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleChapSetting_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the chap setting.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleChapSetting_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Backing field for property. + private string _chapUserName; + + /// The chap user name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The chap user name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The chap user name.", + SerializedName = @"chapUserName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ChapUserName { get => this._chapUserName; set => this._chapUserName = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleChapSetting_Delete + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleChapSetting_Delete Clone() + { + var clone = new RemoveAzStorSimpleChapSetting_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.ChapUserName = this.ChapUserName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ChapSettingsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ChapSettingsDelete(DeviceName, ChapUserName, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,ChapUserName=ChapUserName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleChapSetting_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ChapUserName=ChapUserName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, ChapUserName=ChapUserName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleChapSetting_DeleteViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleChapSetting_DeleteViaIdentity.cs new file mode 100644 index 000000000000..92cb20b027c6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleChapSetting_DeleteViaIdentity.cs @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the chap setting. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleChapSetting_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the chap setting.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleChapSetting_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleChapSetting_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleChapSetting_DeleteViaIdentity Clone() + { + var clone = new RemoveAzStorSimpleChapSetting_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ChapSettingsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ChapSettingsDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ChapUserName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ChapUserName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ChapSettingsDelete(InputObject.DeviceName ?? null, InputObject.ChapUserName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleChapSetting_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleDevice_Delete.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleDevice_Delete.cs new file mode 100644 index 000000000000..4926d6e94cfe --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleDevice_Delete.cs @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleDevice_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleDevice_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DeviceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleDevice_Delete + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleDevice_Delete Clone() + { + var clone = new RemoveAzStorSimpleDevice_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesDelete(Name, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleDevice_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleDevice_DeleteViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleDevice_DeleteViaIdentity.cs new file mode 100644 index 000000000000..eeabcea82ed6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleDevice_DeleteViaIdentity.cs @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the device. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleDevice_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleDevice_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleDevice_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleDevice_DeleteViaIdentity Clone() + { + var clone = new RemoveAzStorSimpleDevice_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DevicesDelete(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleDevice_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleFileServer_Delete.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleFileServer_Delete.cs new file mode 100644 index 000000000000..d593cbd14848 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleFileServer_Delete.cs @@ -0,0 +1,505 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the file server. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleFileServer_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the file server.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleFileServer_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The file server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file server name.", + SerializedName = @"fileServerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("FileServerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleFileServer_Delete + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleFileServer_Delete Clone() + { + var clone = new RemoveAzStorSimpleFileServer_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileServersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileServersDelete(DeviceName, Name, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleFileServer_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleFileServer_DeleteViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleFileServer_DeleteViaIdentity.cs new file mode 100644 index 000000000000..fab56a04776a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleFileServer_DeleteViaIdentity.cs @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the file server. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleFileServer_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the file server.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleFileServer_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleFileServer_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleFileServer_DeleteViaIdentity Clone() + { + var clone = new RemoveAzStorSimpleFileServer_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileServersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FileServersDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FileServerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FileServerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FileServersDelete(InputObject.DeviceName ?? null, InputObject.FileServerName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleFileServer_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleFileShare_Delete.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleFileShare_Delete.cs new file mode 100644 index 000000000000..8dc0d9924886 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleFileShare_Delete.cs @@ -0,0 +1,519 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the file share. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleFileShare_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the file share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleFileShare_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _fileServerName; + + /// The file server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file server name.", + SerializedName = @"fileServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string FileServerName { get => this._fileServerName; set => this._fileServerName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// The file share Name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The file share Name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The file share Name", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleFileShare_Delete + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleFileShare_Delete Clone() + { + var clone = new RemoveAzStorSimpleFileShare_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.FileServerName = this.FileServerName; + clone.ShareName = this.ShareName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesDelete(DeviceName, FileServerName, ShareName, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,FileServerName=FileServerName,ShareName=ShareName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleFileShare_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, ShareName=ShareName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, FileServerName=FileServerName, ShareName=ShareName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleFileShare_DeleteViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleFileShare_DeleteViaIdentity.cs new file mode 100644 index 000000000000..142cc72f02d7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleFileShare_DeleteViaIdentity.cs @@ -0,0 +1,465 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the file share. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleFileShare_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the file share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleFileShare_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleFileShare_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleFileShare_DeleteViaIdentity Clone() + { + var clone = new RemoveAzStorSimpleFileShare_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FileSharesDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.FileServerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FileServerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ShareName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ShareName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FileSharesDelete(InputObject.DeviceName ?? null, InputObject.FileServerName ?? null, InputObject.ShareName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleFileShare_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleIscsiDisk_Delete.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleIscsiDisk_Delete.cs new file mode 100644 index 000000000000..74964671b553 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleIscsiDisk_Delete.cs @@ -0,0 +1,519 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the iSCSI disk. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleIscsiDisk_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the iSCSI disk.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleIscsiDisk_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// Backing field for property. + private string _diskName; + + /// The disk name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The disk name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The disk name.", + SerializedName = @"diskName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DiskName { get => this._diskName; set => this._diskName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _iscsiServerName; + + /// The iSCSI server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI server name.", + SerializedName = @"iscsiServerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string IscsiServerName { get => this._iscsiServerName; set => this._iscsiServerName = value; } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleIscsiDisk_Delete + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleIscsiDisk_Delete Clone() + { + var clone = new RemoveAzStorSimpleIscsiDisk_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.IscsiServerName = this.IscsiServerName; + clone.DiskName = this.DiskName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IscsiDisksDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiDisksDelete(DeviceName, IscsiServerName, DiskName, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,IscsiServerName=IscsiServerName,DiskName=DiskName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleIscsiDisk_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, DiskName=DiskName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, IscsiServerName=IscsiServerName, DiskName=DiskName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleIscsiDisk_DeleteViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleIscsiDisk_DeleteViaIdentity.cs new file mode 100644 index 000000000000..8d5ba471f3ca --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleIscsiDisk_DeleteViaIdentity.cs @@ -0,0 +1,465 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the iSCSI disk. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleIscsiDisk_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the iSCSI disk.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleIscsiDisk_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleIscsiDisk_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleIscsiDisk_DeleteViaIdentity Clone() + { + var clone = new RemoveAzStorSimpleIscsiDisk_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IscsiDisksDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.IscsiDisksDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.IscsiServerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.IscsiServerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DiskName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DiskName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.IscsiDisksDelete(InputObject.DeviceName ?? null, InputObject.IscsiServerName ?? null, InputObject.DiskName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleIscsiDisk_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleIscsiServer_Delete.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleIscsiServer_Delete.cs new file mode 100644 index 000000000000..88f15a746286 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleIscsiServer_Delete.cs @@ -0,0 +1,505 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the iSCSI server. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleIscsiServer_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the iSCSI server.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleIscsiServer_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The iSCSI server name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The iSCSI server name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The iSCSI server name.", + SerializedName = @"iscsiServerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("IscsiServerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleIscsiServer_Delete + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleIscsiServer_Delete Clone() + { + var clone = new RemoveAzStorSimpleIscsiServer_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DeviceName = this.DeviceName; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IscsiServersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.IscsiServersDelete(DeviceName, Name, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleIscsiServer_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleIscsiServer_DeleteViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleIscsiServer_DeleteViaIdentity.cs new file mode 100644 index 000000000000..67dcb83cf496 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleIscsiServer_DeleteViaIdentity.cs @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the iSCSI server. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleIscsiServer_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the iSCSI server.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleIscsiServer_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleIscsiServer_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleIscsiServer_DeleteViaIdentity Clone() + { + var clone = new RemoveAzStorSimpleIscsiServer_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'IscsiServersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.IscsiServersDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.IscsiServerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.IscsiServerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.IscsiServersDelete(InputObject.DeviceName ?? null, InputObject.IscsiServerName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleIscsiServer_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleManagerExtendedInfo_Delete.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleManagerExtendedInfo_Delete.cs new file mode 100644 index 000000000000..87f085ed29b3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleManagerExtendedInfo_Delete.cs @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the extended info of the manager. + /// + /// [OpenAPI] DeleteExtendedInfo=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleManagerExtendedInfo_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the extended info of the manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleManagerExtendedInfo_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersDeleteExtendedInfo' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersDeleteExtendedInfo(SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleManagerExtendedInfo_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleManagerExtendedInfo_DeleteViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleManagerExtendedInfo_DeleteViaIdentity.cs new file mode 100644 index 000000000000..c9a669daf6dc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleManagerExtendedInfo_DeleteViaIdentity.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the extended info of the manager. + /// + /// [OpenAPI] DeleteExtendedInfo=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleManagerExtendedInfo_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the extended info of the manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleManagerExtendedInfo_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersDeleteExtendedInfo' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagersDeleteExtendedInfoViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagersDeleteExtendedInfo(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleManagerExtendedInfo_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleManager_Delete.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleManager_Delete.cs new file mode 100644 index 000000000000..4ac117ae535a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleManager_Delete.cs @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the manager. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleManager_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleManager_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ManagerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersDelete(SubscriptionId, ResourceGroupName, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleManager_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleManager_DeleteViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleManager_DeleteViaIdentity.cs new file mode 100644 index 000000000000..539b07ec5fb0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleManager_DeleteViaIdentity.cs @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the manager. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleManager_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleManager_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagersDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagersDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleManager_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleStorageAccountCredentials_Delete.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleStorageAccountCredentials_Delete.cs new file mode 100644 index 000000000000..c33ebe7f42d5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleStorageAccountCredentials_Delete.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the storage account credential + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleStorageAccountCredentials_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the storage account credential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleStorageAccountCredentials_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _credentialName; + + /// The name of the storage account credential. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account credential.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account credential.", + SerializedName = @"credentialName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string CredentialName { get => this._credentialName; set => this._credentialName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleStorageAccountCredentials_Delete + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleStorageAccountCredentials_Delete Clone() + { + var clone = new RemoveAzStorSimpleStorageAccountCredentials_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.CredentialName = this.CredentialName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountCredentialsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountCredentialsDelete(CredentialName, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CredentialName=CredentialName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleStorageAccountCredentials_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CredentialName=CredentialName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { CredentialName=CredentialName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleStorageAccountCredentials_DeleteViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleStorageAccountCredentials_DeleteViaIdentity.cs new file mode 100644 index 000000000000..d8389b3cb920 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleStorageAccountCredentials_DeleteViaIdentity.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the storage account credential + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleStorageAccountCredentials_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the storage account credential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleStorageAccountCredentials_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzStorSimpleStorageAccountCredentials_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleStorageAccountCredentials_DeleteViaIdentity Clone() + { + var clone = new RemoveAzStorSimpleStorageAccountCredentials_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountCredentialsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountCredentialsDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.CredentialName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.CredentialName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountCredentialsDelete(InputObject.CredentialName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleStorageAccountCredentials_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleStorageDomain_Delete.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleStorageDomain_Delete.cs new file mode 100644 index 000000000000..74250bfd3131 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleStorageDomain_Delete.cs @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the storage domain. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleStorageDomain_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the storage domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleStorageDomain_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The storage domain name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage domain name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage domain name.", + SerializedName = @"storageDomainName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("StorageDomainName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleStorageDomain_Delete + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleStorageDomain_Delete Clone() + { + var clone = new RemoveAzStorSimpleStorageDomain_Delete(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageDomainsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageDomainsDelete(Name, SubscriptionId, ResourceGroupName, ManagerName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleStorageDomain_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleStorageDomain_DeleteViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleStorageDomain_DeleteViaIdentity.cs new file mode 100644 index 000000000000..c476989d0ab2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/RemoveAzStorSimpleStorageDomain_DeleteViaIdentity.cs @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Deletes the storage domain. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorSimpleStorageDomain_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Deletes the storage domain.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class RemoveAzStorSimpleStorageDomain_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzStorSimpleStorageDomain_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.RemoveAzStorSimpleStorageDomain_DeleteViaIdentity Clone() + { + var clone = new RemoveAzStorSimpleStorageDomain_DeleteViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageDomainsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageDomainsDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.StorageDomainName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.StorageDomainName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageDomainsDelete(InputObject.StorageDomainName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorSimpleStorageDomain_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/SendAzStorSimpleAlertTestEmail_Send.cs b/swaggerci/storSimple1200Series/generated/cmdlets/SendAzStorSimpleAlertTestEmail_Send.cs new file mode 100644 index 000000000000..ebe6defb6da9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/SendAzStorSimpleAlertTestEmail_Send.cs @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Sends a test alert email. + /// + /// [OpenAPI] SendTestEmail=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/sendTestAlertEmail" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommunications.Send, @"AzStorSimpleAlertTestEmail_Send", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Sends a test alert email.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class SendAzStorSimpleAlertTestEmail_Send : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest _request; + + /// Request for sending test alert email + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Request for sending test alert email", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Request for sending test alert email", + SerializedName = @"request", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest Request { get => this._request; set => this._request = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AlertsSendTestEmail' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsSendTestEmail(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, Request, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=Request}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public SendAzStorSimpleAlertTestEmail_Send() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=Request }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=Request }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/SendAzStorSimpleAlertTestEmail_SendExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/SendAzStorSimpleAlertTestEmail_SendExpanded.cs new file mode 100644 index 000000000000..45aa35364990 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/SendAzStorSimpleAlertTestEmail_SendExpanded.cs @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Sends a test alert email. + /// + /// [OpenAPI] SendTestEmail=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/sendTestAlertEmail" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommunications.Send, @"AzStorSimpleAlertTestEmail_SendExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Sends a test alert email.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class SendAzStorSimpleAlertTestEmail_SendExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Request for sending test alert email + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest _requestBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SendTestAlertEmailRequest(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// List of emails to send the test alerts + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "List of emails to send the test alerts")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of emails to send the test alerts", + SerializedName = @"emailList", + PossibleTypes = new [] { typeof(string) })] + public string[] EmailList { get => _requestBody.EmailList ?? null /* arrayOf */; set => _requestBody.EmailList = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AlertsSendTestEmail' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsSendTestEmail(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, _requestBody, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_requestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public SendAzStorSimpleAlertTestEmail_SendExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_requestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_requestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/SendAzStorSimpleAlertTestEmail_SendViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/SendAzStorSimpleAlertTestEmail_SendViaIdentity.cs new file mode 100644 index 000000000000..8b33226955dd --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/SendAzStorSimpleAlertTestEmail_SendViaIdentity.cs @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Sends a test alert email. + /// + /// [OpenAPI] SendTestEmail=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/sendTestAlertEmail" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommunications.Send, @"AzStorSimpleAlertTestEmail_SendViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Sends a test alert email.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class SendAzStorSimpleAlertTestEmail_SendViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest _request; + + /// Request for sending test alert email + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Request for sending test alert email", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Request for sending test alert email", + SerializedName = @"request", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest Request { get => this._request; set => this._request = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AlertsSendTestEmail' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AlertsSendTestEmailViaIdentity(InputObject.Id, Request, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AlertsSendTestEmail(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, Request, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Request}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public SendAzStorSimpleAlertTestEmail_SendViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Request }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Request }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/SendAzStorSimpleAlertTestEmail_SendViaIdentityExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/SendAzStorSimpleAlertTestEmail_SendViaIdentityExpanded.cs new file mode 100644 index 000000000000..197fc507d47b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/SendAzStorSimpleAlertTestEmail_SendViaIdentityExpanded.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Sends a test alert email. + /// + /// [OpenAPI] SendTestEmail=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/sendTestAlertEmail" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommunications.Send, @"AzStorSimpleAlertTestEmail_SendViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Sends a test alert email.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class SendAzStorSimpleAlertTestEmail_SendViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Request for sending test alert email + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISendTestAlertEmailRequest _requestBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SendTestAlertEmailRequest(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// List of emails to send the test alerts + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "List of emails to send the test alerts")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"List of emails to send the test alerts", + SerializedName = @"emailList", + PossibleTypes = new [] { typeof(string) })] + public string[] EmailList { get => _requestBody.EmailList ?? null /* arrayOf */; set => _requestBody.EmailList = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AlertsSendTestEmail' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AlertsSendTestEmailViaIdentity(InputObject.Id, _requestBody, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AlertsSendTestEmail(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, _requestBody, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_requestBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public SendAzStorSimpleAlertTestEmail_SendViaIdentityExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_requestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_requestBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDeviceSecuritySetting_UpdateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDeviceSecuritySetting_UpdateExpanded.cs new file mode 100644 index 000000000000..5f0eb96bef76 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDeviceSecuritySetting_UpdateExpanded.cs @@ -0,0 +1,530 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or updates the security settings. + /// + /// [OpenAPI] CreateOrUpdateSecuritySettings=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/securitySettings/default/update" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorSimpleDeviceSecuritySetting_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or updates the security settings.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class UpdateAzStorSimpleDeviceSecuritySetting_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The SecuritySettings of a device + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings _securitySettingsBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SecuritySettings(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Algorithm used to encrypt "Value" + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Algorithm used to encrypt \"Value\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get => _securitySettingsBody.DeviceAdminPasswordEncryptionAlgorithm; set => _securitySettingsBody.DeviceAdminPasswordEncryptionAlgorithm = value; } + + /// Thumbprint certificate that was used to encrypt "Value" + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Thumbprint certificate that was used to encrypt \"Value\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string DeviceAdminPasswordEncryptionCertificateThumbprint { get => _securitySettingsBody.DeviceAdminPasswordEncryptionCertificateThumbprint ?? null; set => _securitySettingsBody.DeviceAdminPasswordEncryptionCertificateThumbprint = value; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + public string DeviceAdminPasswordValue { get => _securitySettingsBody.DeviceAdminPasswordValue ?? null; set => _securitySettingsBody.DeviceAdminPasswordValue = value; } + + /// Backing field for property. + private string _deviceName; + + /// The device name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string DeviceName { get => this._deviceName; set => this._deviceName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzStorSimpleDeviceSecuritySetting_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.UpdateAzStorSimpleDeviceSecuritySetting_UpdateExpanded Clone() + { + var clone = new UpdateAzStorSimpleDeviceSecuritySetting_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._securitySettingsBody = this._securitySettingsBody; + clone.DeviceName = this.DeviceName; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesCreateOrUpdateSecuritySettings' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesCreateOrUpdateSecuritySettings(DeviceName, SubscriptionId, ResourceGroupName, ManagerName, _securitySettingsBody, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_securitySettingsBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorSimpleDeviceSecuritySetting_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_securitySettingsBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DeviceName=DeviceName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_securitySettingsBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDeviceSecuritySetting_UpdateViaIdentityExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDeviceSecuritySetting_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..ba7c2db8adc9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDeviceSecuritySetting_UpdateViaIdentityExpanded.cs @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Creates or updates the security settings. + /// + /// [OpenAPI] CreateOrUpdateSecuritySettings=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/securitySettings/default/update" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorSimpleDeviceSecuritySetting_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Creates or updates the security settings.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class UpdateAzStorSimpleDeviceSecuritySetting_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The SecuritySettings of a device + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ISecuritySettings _securitySettingsBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.SecuritySettings(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Algorithm used to encrypt "Value" + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Algorithm used to encrypt \"Value\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Algorithm used to encrypt ""Value""", + SerializedName = @"encryptionAlgorithm", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm))] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support.EncryptionAlgorithm DeviceAdminPasswordEncryptionAlgorithm { get => _securitySettingsBody.DeviceAdminPasswordEncryptionAlgorithm; set => _securitySettingsBody.DeviceAdminPasswordEncryptionAlgorithm = value; } + + /// Thumbprint certificate that was used to encrypt "Value" + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Thumbprint certificate that was used to encrypt \"Value\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Thumbprint certificate that was used to encrypt ""Value""", + SerializedName = @"encryptionCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string DeviceAdminPasswordEncryptionCertificateThumbprint { get => _securitySettingsBody.DeviceAdminPasswordEncryptionCertificateThumbprint ?? null; set => _securitySettingsBody.DeviceAdminPasswordEncryptionCertificateThumbprint = value; } + + /// + /// The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint + /// will be null. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The value of the secret itself. If the secret is in plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint will be null.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + public string DeviceAdminPasswordValue { get => _securitySettingsBody.DeviceAdminPasswordValue ?? null; set => _securitySettingsBody.DeviceAdminPasswordValue = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzStorSimpleDeviceSecuritySetting_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.UpdateAzStorSimpleDeviceSecuritySetting_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzStorSimpleDeviceSecuritySetting_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._securitySettingsBody = this._securitySettingsBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesCreateOrUpdateSecuritySettings' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesCreateOrUpdateSecuritySettingsViaIdentity(InputObject.Id, _securitySettingsBody, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DevicesCreateOrUpdateSecuritySettings(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, _securitySettingsBody, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_securitySettingsBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzStorSimpleDeviceSecuritySetting_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_securitySettingsBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_securitySettingsBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDevice_Patch.cs b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDevice_Patch.cs new file mode 100644 index 000000000000..ce1774fd91ca --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDevice_Patch.cs @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Patches the device. + /// + /// [OpenAPI] Patch=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorSimpleDevice_Patch", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Patches the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class UpdateAzStorSimpleDevice_Patch : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch _devicePatch; + + /// + /// Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is \"DeviceDescription\"", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is ""DeviceDescription""", + SerializedName = @"devicePatch", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch) })] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch DevicePatch { get => this._devicePatch; set => this._devicePatch = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The device Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device Name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DeviceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzStorSimpleDevice_Patch + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.UpdateAzStorSimpleDevice_Patch Clone() + { + var clone = new UpdateAzStorSimpleDevice_Patch(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + clone.DevicePatch = this.DevicePatch; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesPatch' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesPatch(Name, SubscriptionId, ResourceGroupName, ManagerName, DevicePatch, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=DevicePatch}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorSimpleDevice_Patch() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=DevicePatch }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=DevicePatch }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDevice_PatchExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDevice_PatchExpanded.cs new file mode 100644 index 000000000000..8c48f167b7cf --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDevice_PatchExpanded.cs @@ -0,0 +1,502 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Patches the device. + /// + /// [OpenAPI] Patch=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorSimpleDevice_PatchExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Patches the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class UpdateAzStorSimpleDevice_PatchExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch _devicePatchBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DevicePatch(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Short description given for the device + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Short description given for the device")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Short description given for the device", + SerializedName = @"deviceDescription", + PossibleTypes = new [] { typeof(string) })] + public string DeviceDescription { get => _devicePatchBody.DeviceDescription ?? null; set => _devicePatchBody.DeviceDescription = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The device Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The device Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The device Name.", + SerializedName = @"deviceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DeviceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzStorSimpleDevice_PatchExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.UpdateAzStorSimpleDevice_PatchExpanded Clone() + { + var clone = new UpdateAzStorSimpleDevice_PatchExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._devicePatchBody = this._devicePatchBody; + clone.Name = this.Name; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ManagerName = this.ManagerName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesPatch' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DevicesPatch(Name, SubscriptionId, ResourceGroupName, ManagerName, _devicePatchBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,body=_devicePatchBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorSimpleDevice_PatchExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_devicePatchBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, body=_devicePatchBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDevice_PatchViaIdentity.cs b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDevice_PatchViaIdentity.cs new file mode 100644 index 000000000000..9407700c33bd --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDevice_PatchViaIdentity.cs @@ -0,0 +1,468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Patches the device. + /// + /// [OpenAPI] Patch=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorSimpleDevice_PatchViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Patches the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class UpdateAzStorSimpleDevice_PatchViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch _devicePatch; + + /// + /// Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is \"DeviceDescription\"", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is ""DeviceDescription""", + SerializedName = @"devicePatch", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch) })] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch DevicePatch { get => this._devicePatch; set => this._devicePatch = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzStorSimpleDevice_PatchViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.UpdateAzStorSimpleDevice_PatchViaIdentity Clone() + { + var clone = new UpdateAzStorSimpleDevice_PatchViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DevicePatch = this.DevicePatch; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesPatch' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesPatchViaIdentity(InputObject.Id, DevicePatch, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DevicesPatch(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, DevicePatch, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=DevicePatch}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorSimpleDevice_PatchViaIdentity() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=DevicePatch }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=DevicePatch }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDevice_PatchViaIdentityExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDevice_PatchViaIdentityExpanded.cs new file mode 100644 index 000000000000..c95f6ae81483 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleDevice_PatchViaIdentityExpanded.cs @@ -0,0 +1,469 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Patches the device. + /// + /// [OpenAPI] Patch=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorSimpleDevice_PatchViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Patches the device.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class UpdateAzStorSimpleDevice_PatchViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// Class that represents the Input for the PATCH call on Device. Currently the only patchable property on device is "DeviceDescription" + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevicePatch _devicePatchBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.DevicePatch(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Short description given for the device + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Short description given for the device")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Short description given for the device", + SerializedName = @"deviceDescription", + PossibleTypes = new [] { typeof(string) })] + public string DeviceDescription { get => _devicePatchBody.DeviceDescription ?? null; set => _devicePatchBody.DeviceDescription = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzStorSimpleDevice_PatchViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets.UpdateAzStorSimpleDevice_PatchViaIdentityExpanded Clone() + { + var clone = new UpdateAzStorSimpleDevice_PatchViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._devicePatchBody = this._devicePatchBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DevicesPatch' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DevicesPatchViaIdentity(InputObject.Id, _devicePatchBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeviceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeviceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DevicesPatch(InputObject.DeviceName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, _devicePatchBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_devicePatchBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorSimpleDevice_PatchViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_devicePatchBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_devicePatchBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IDevice + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleManagerExtendedInfo_UpdateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleManagerExtendedInfo_UpdateExpanded.cs new file mode 100644 index 000000000000..7ff2f333d3d2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleManagerExtendedInfo_UpdateExpanded.cs @@ -0,0 +1,502 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Updates the extended info of the manager. + /// + /// [OpenAPI] UpdateExtendedInfo=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorSimpleManagerExtendedInfo_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Updates the extended info of the manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class UpdateAzStorSimpleManagerExtendedInfo_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The extended info of the manager. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo _managerExtendedInfoBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfo(); + + /// + /// Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. + /// AlgorithmName - if encryption is used + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. AlgorithmName - if encryption is used")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. AlgorithmName - if encryption is used", + SerializedName = @"algorithm", + PossibleTypes = new [] { typeof(string) })] + public string Algorithm { get => _managerExtendedInfoBody.Algorithm ?? null; set => _managerExtendedInfoBody.Algorithm = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Represents the CEK of the resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Represents the CEK of the resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the CEK of the resource", + SerializedName = @"encryptionKey", + PossibleTypes = new [] { typeof(string) })] + public string EncryptionKey { get => _managerExtendedInfoBody.EncryptionKey ?? null; set => _managerExtendedInfoBody.EncryptionKey = value; } + + /// Represents the Cert thumbprint that was used to encrypt the CEK + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Represents the Cert thumbprint that was used to encrypt the CEK")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the Cert thumbprint that was used to encrypt the CEK", + SerializedName = @"encryptionKeyThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string EncryptionKeyThumbprint { get => _managerExtendedInfoBody.EncryptionKeyThumbprint ?? null; set => _managerExtendedInfoBody.EncryptionKeyThumbprint = value; } + + /// ETag of the Resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ETag of the Resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ETag of the Resource", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _managerExtendedInfoBody.Etag ?? null; set => _managerExtendedInfoBody.Etag = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// Pass the ETag of ExtendedInfo fetched from GET call + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Pass the ETag of ExtendedInfo fetched from GET call")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Pass the ETag of ExtendedInfo fetched from GET call", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Represents the CIK of the resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Represents the CIK of the resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Represents the CIK of the resource", + SerializedName = @"integrityKey", + PossibleTypes = new [] { typeof(string) })] + public string IntegrityKey { get => _managerExtendedInfoBody.IntegrityKey ?? null; set => _managerExtendedInfoBody.IntegrityKey = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _managerName; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ManagerName { get => this._managerName; set => this._managerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it.", + SerializedName = @"portalCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string PortalCertificateThumbprint { get => _managerExtendedInfoBody.PortalCertificateThumbprint ?? null; set => _managerExtendedInfoBody.PortalCertificateThumbprint = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Represents the version of the ExtendedInfo object being persisted + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Represents the version of the ExtendedInfo object being persisted")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the version of the ExtendedInfo object being persisted", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + public string Version { get => _managerExtendedInfoBody.Version ?? null; set => _managerExtendedInfoBody.Version = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersUpdateExtendedInfo' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersUpdateExtendedInfo(SubscriptionId, ResourceGroupName, ManagerName, IfMatch, _managerExtendedInfoBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ManagerName=ManagerName,IfMatch=IfMatch,body=_managerExtendedInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorSimpleManagerExtendedInfo_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, IfMatch=IfMatch, body=_managerExtendedInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ManagerName=ManagerName, IfMatch=IfMatch, body=_managerExtendedInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleManagerExtendedInfo_UpdateViaIdentityExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleManagerExtendedInfo_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..1bbec86d1966 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleManagerExtendedInfo_UpdateViaIdentityExpanded.cs @@ -0,0 +1,485 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Updates the extended info of the manager. + /// + /// [OpenAPI] UpdateExtendedInfo=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorSimpleManagerExtendedInfo_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Updates the extended info of the manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class UpdateAzStorSimpleManagerExtendedInfo_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The extended info of the manager. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo _managerExtendedInfoBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerExtendedInfo(); + + /// + /// Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. + /// AlgorithmName - if encryption is used + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. AlgorithmName - if encryption is used")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Represents the encryption algorithm used to encrypt the other keys. None - if EncryptionKey is saved in plain text format. AlgorithmName - if encryption is used", + SerializedName = @"algorithm", + PossibleTypes = new [] { typeof(string) })] + public string Algorithm { get => _managerExtendedInfoBody.Algorithm ?? null; set => _managerExtendedInfoBody.Algorithm = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Represents the CEK of the resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Represents the CEK of the resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the CEK of the resource", + SerializedName = @"encryptionKey", + PossibleTypes = new [] { typeof(string) })] + public string EncryptionKey { get => _managerExtendedInfoBody.EncryptionKey ?? null; set => _managerExtendedInfoBody.EncryptionKey = value; } + + /// Represents the Cert thumbprint that was used to encrypt the CEK + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Represents the Cert thumbprint that was used to encrypt the CEK")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the Cert thumbprint that was used to encrypt the CEK", + SerializedName = @"encryptionKeyThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string EncryptionKeyThumbprint { get => _managerExtendedInfoBody.EncryptionKeyThumbprint ?? null; set => _managerExtendedInfoBody.EncryptionKeyThumbprint = value; } + + /// ETag of the Resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ETag of the Resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ETag of the Resource", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + public string Etag { get => _managerExtendedInfoBody.Etag ?? null; set => _managerExtendedInfoBody.Etag = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// Pass the ETag of ExtendedInfo fetched from GET call + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Pass the ETag of ExtendedInfo fetched from GET call")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Pass the ETag of ExtendedInfo fetched from GET call", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Represents the CIK of the resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Represents the CIK of the resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Represents the CIK of the resource", + SerializedName = @"integrityKey", + PossibleTypes = new [] { typeof(string) })] + public string IntegrityKey { get => _managerExtendedInfoBody.IntegrityKey ?? null; set => _managerExtendedInfoBody.IntegrityKey = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it.", + SerializedName = @"portalCertificateThumbprint", + PossibleTypes = new [] { typeof(string) })] + public string PortalCertificateThumbprint { get => _managerExtendedInfoBody.PortalCertificateThumbprint ?? null; set => _managerExtendedInfoBody.PortalCertificateThumbprint = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Represents the version of the ExtendedInfo object being persisted + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Represents the version of the ExtendedInfo object being persisted")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Represents the version of the ExtendedInfo object being persisted", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + public string Version { get => _managerExtendedInfoBody.Version ?? null; set => _managerExtendedInfoBody.Version = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersUpdateExtendedInfo' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagersUpdateExtendedInfoViaIdentity(InputObject.Id, IfMatch, _managerExtendedInfoBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagersUpdateExtendedInfo(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, IfMatch, _managerExtendedInfoBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=IfMatch,body=_managerExtendedInfoBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzStorSimpleManagerExtendedInfo_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=IfMatch, body=_managerExtendedInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=IfMatch, body=_managerExtendedInfoBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerExtendedInfo + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleManager_UpdateExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleManager_UpdateExpanded.cs new file mode 100644 index 000000000000..89588a2118d4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleManager_UpdateExpanded.cs @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Updates the StorSimple Manager. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorSimpleManager_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Updates the StorSimple Manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class UpdateAzStorSimpleManager_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The StorSimple Manager patch. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerPatch(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The manager name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The manager name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The manager name", + SerializedName = @"managerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ManagerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The resource group name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription id + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription id")] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription id", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// The tags attached to the StorSimple Manager. + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tags attached to the StorSimple Manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tags attached to the StorSimple Manager.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagersUpdate(SubscriptionId, ResourceGroupName, Name, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorSimpleManager_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleManager_UpdateViaIdentityExpanded.cs b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleManager_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..dbe9f65bd384 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/cmdlets/UpdateAzStorSimpleManager_UpdateViaIdentityExpanded.cs @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + using System; + + /// Updates the StorSimple Manager. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorSimpleManager_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager))] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Description(@"Updates the StorSimple Manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Generated] + public partial class UpdateAzStorSimpleManager_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The StorSimple Manager patch. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.ManagerPatch(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.StorSimpleManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.IStorSimpleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The tags attached to the StorSimple Manager. + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tags attached to the StorSimple Manager.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Category(global::Microsoft.Azure.PowerShell.Cmdlets.StorSimple.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tags attached to the StorSimple Manager.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManagerPatchTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagersUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagersUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ManagerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagersUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ManagerName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorSimpleManager_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.MessageLanguage; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models.Api20161001.IManager + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml new file mode 100644 index 000000000000..ae0c12dd4efa --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml @@ -0,0 +1,496 @@ + + + + + AzureErrorRecords + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + AzureErrorRecords + + + $_.InvocationInfo.HistoryId + + + + + + + + ErrorCategory + + + ErrorDetail + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.BoundParameters + + + + $_.InvocationInfo.UnboundParameters + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord] + + + + + RequestId + + + Message + + + ServerMessage + + + ServerResponse + + + RequestMessage + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + StackTrace + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord] + + + + + Message + + + StackTrace + + + + $_.Exception.GetType() + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.HistoryId + + + + + + + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Description + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + Token + + + ExpiresOn + + + Type + + + TenantId + + + UserId + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + + + + Left + + + + Left + + + + Left + + + + + + + + Left + locationPlacementId + + + Left + QuotaId + + + Left + SpendingLimit + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + Id + + + Type + + + Tenants + + + Credential + + + TenantMap + + + CertificateThumbprint + + + + $_.ExtendedProperties.GetEnumerator() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml new file mode 100644 index 000000000000..a81dae94b4db --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml @@ -0,0 +1,468 @@ + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + ResourceManagerUrl + + + Left + ActiveDirectoryAuthority + + + Left + Type + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Id + + + Left + TenantId + + + Left + State + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + $_.Context.Account.ToString() + + + Left + $_.Context.Subscription.Name + + + Left + $_.Context.Tenant.ToString() + + + Left + $_.Context.Environment.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + 40 + Left + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Account + + + Left + $_.Subscription.Name + + + Left + Environment + + + Left + $_.Tenant.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Id + + + Left + $_.Name + + + Left + $_.TenantCategory + + + Left + $_.Domains + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml new file mode 100644 index 000000000000..e3b670a7daff --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml @@ -0,0 +1,303 @@ + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.AuthenticationStoreTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.ProtectedFileTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + Microsoft.Azure.Commands.Profile.Models.AzureContextConverter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec new file mode 100644 index 000000000000..f664d888f3b8 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec @@ -0,0 +1,20 @@ + + + + Az.Accounts + 2.7.5 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps + * Added 'SshCredentialFactory' to support get ssh credential of vm from msal. +* Fixed the bug of cmdlet fails when -DefaultProfile is set to service principal login context. [#16617] +* Fixed the issue that authorization does not work in Dogfood environment + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest + + \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 new file mode 100644 index 000000000000..5597a247fce7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 @@ -0,0 +1,387 @@ +# +# Module manifest for module 'Az.Accounts' +# +# Generated by: Microsoft Corporation +# +# Generated on: 3/31/2022 +# + +@{ + +# Script module or binary module file associated with this manifest. +RootModule = 'Az.Accounts.psm1' + +# Version number of this module. +ModuleVersion = '2.7.5' + +# Supported PSEditions +CompatiblePSEditions = 'Core', 'Desktop' + +# ID used to uniquely identify this module +GUID = '17a2feff-488b-47f9-8729-e2cec094624c' + +# Author of this module +Author = 'Microsoft Corporation' + +# Company or vendor of this module +CompanyName = 'Microsoft Corporation' + +# Copyright statement for this module +Copyright = 'Microsoft Corporation. All rights reserved.' + +# Description of the functionality provided by this module +Description = 'Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps' + +# Minimum version of the PowerShell engine required by this module +PowerShellVersion = '5.1' + +# Name of the PowerShell host required by this module +# PowerShellHostName = '' + +# Minimum version of the PowerShell host required by this module +# PowerShellHostVersion = '' + +# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +DotNetFrameworkVersion = '4.7.2' + +# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +# ClrVersion = '' + +# Processor architecture (None, X86, Amd64) required by this module +# ProcessorArchitecture = '' + +# Modules that must be imported into the global environment prior to importing this module +# RequiredModules = @() + +# Assemblies that must be loaded prior to importing this module +RequiredAssemblies = 'Microsoft.Azure.PowerShell.Authentication.Abstractions.dll', + 'Microsoft.Azure.PowerShell.Authentication.dll', + 'Microsoft.Azure.PowerShell.Authenticators.dll', + 'Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Clients.Authorization.dll', + 'Microsoft.Azure.PowerShell.Clients.Compute.dll', + 'Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll', + 'Microsoft.Azure.PowerShell.Clients.Monitor.dll', + 'Microsoft.Azure.PowerShell.Clients.Network.dll', + 'Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll', + 'Microsoft.Azure.PowerShell.Clients.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Common.dll', + 'Microsoft.Azure.PowerShell.Storage.dll', + 'Microsoft.Azure.PowerShell.Clients.Storage.Management.dll', + 'Microsoft.Azure.PowerShell.Clients.KeyVault.dll', + 'Microsoft.Azure.PowerShell.Clients.Websites.dll', + 'Hyak.Common.dll', 'Microsoft.ApplicationInsights.dll', + 'Microsoft.Azure.Common.dll', 'Microsoft.Rest.ClientRuntime.dll', + 'Microsoft.Rest.ClientRuntime.Azure.dll', + 'Microsoft.WindowsAzure.Storage.dll', + 'Microsoft.WindowsAzure.Storage.DataMovement.dll', + 'Microsoft.Azure.PowerShell.Clients.Aks.dll', + 'Microsoft.Azure.PowerShell.Strategies.dll', + 'Microsoft.Azure.PowerShell.Common.Share.dll' + +# Script files (.ps1) that are run in the caller's environment prior to importing this module. +# ScriptsToProcess = @() + +# Type files (.ps1xml) to be loaded when importing this module +# TypesToProcess = @() + +# Format files (.ps1xml) to be loaded when importing this module +FormatsToProcess = 'Accounts.format.ps1xml', 'Accounts.generated.format.ps1xml' + +# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess +NestedModules = @() + +# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. +FunctionsToExport = @() + +# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. +CmdletsToExport = 'Disable-AzDataCollection', 'Disable-AzContextAutosave', + 'Enable-AzDataCollection', 'Enable-AzContextAutosave', + 'Remove-AzEnvironment', 'Get-AzEnvironment', 'Set-AzEnvironment', + 'Add-AzEnvironment', 'Get-AzSubscription', 'Connect-AzAccount', + 'Get-AzContext', 'Set-AzContext', 'Import-AzContext', 'Save-AzContext', + 'Get-AzTenant', 'Send-Feedback', 'Resolve-AzError', 'Select-AzContext', + 'Rename-AzContext', 'Remove-AzContext', 'Clear-AzContext', + 'Disconnect-AzAccount', 'Get-AzContextAutosaveSetting', + 'Set-AzDefault', 'Get-AzDefault', 'Clear-AzDefault', + 'Register-AzModule', 'Enable-AzureRmAlias', 'Disable-AzureRmAlias', + 'Uninstall-AzureRm', 'Invoke-AzRestMethod', 'Get-AzAccessToken', + 'Open-AzSurveyLink' + +# Variables to export from this module +# VariablesToExport = @() + +# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. +AliasesToExport = 'Add-AzAccount', 'Login-AzAccount', 'Remove-AzAccount', + 'Logout-AzAccount', 'Select-AzSubscription', 'Resolve-Error', + 'Save-AzProfile', 'Get-AzDomain', 'Invoke-AzRest' + +# DSC resources to export from this module +# DscResourcesToExport = @() + +# List of all modules packaged with this module +# ModuleList = @() + +# List of all files packaged with this module +# FileList = @() + +# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. +PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = 'Azure','ResourceManager','ARM','Accounts','Authentication','Environment','Subscription' + + # A URL to the license for this module. + LicenseUri = 'https://aka.ms/azps-license' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/Azure/azure-powershell' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + ReleaseNotes = '* Added ''SshCredentialFactory'' to support get ssh credential of vm from msal. +* Fixed the bug of cmdlet fails when -DefaultProfile is set to service principal login context. [#16617] +* Fixed the issue that authorization does not work in Dogfood environment' + + # Prerelease string of this module + # Prerelease = '' + + # Flag to indicate whether the module requires explicit user acceptance for install/update/save + # RequireLicenseAcceptance = $false + + # External dependent modules of this module + # ExternalModuleDependencies = @() + + } # End of PSData hashtable + + } # End of PrivateData hashtable + +# HelpInfo URI of this module +# HelpInfoURI = '' + +# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. +# DefaultCommandPrefix = '' + +} + + +# SIG # Begin signature block +# MIInoQYJKoZIhvcNAQcCoIInkjCCJ44CAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBfih7Yjug0H4t7 +# yWl+P37e8ytBZAxLWrUP62/jyADYPKCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZdjCCGXICAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgXA6GKgxI +# VhLOuEe05JK0ofRRaS3Iixk8S4yAEDyheGcwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCk7+MONSYp7vxlpfSvtfVGPGdZ5LuxWlb4eimh/TgO +# qAAMDghpYUB8mFe46dAf/OoVHrcxhCfAof+aWlMkEqZTwIZ6p0XsXZ72jDLDFLgf +# WJNQ605jndPQx7/b3tDvqqI1sCHz4CvYnqiQn4/JpHjiE4321HRDFjhWv1lhTpMx +# Xaifyrvwc1OwLcSqMrEPSShevbYOH54J0MG+qI+t+AQ9D/WQdL/5HBJZ8PDZ2n9b +# I4FxGwm0aeTSnAiV602r8db+jebwv/5ypKfkok4IzN9qdQY1y3jXdP9MfEK2nCod +# Mbuby8eakQsarqZJovnvBOsZANYE8UafuSbYMQtJaEtnoYIXADCCFvwGCisGAQQB +# gjcDAwExghbsMIIW6AYJKoZIhvcNAQcCoIIW2TCCFtUCAQMxDzANBglghkgBZQME +# AgEFADCCAVEGCyqGSIb3DQEJEAEEoIIBQASCATwwggE4AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIPieBDiQ8jeOJOjc2VK1Wl36ph7izu7GPD9rSN/j +# BxeOAgZiFm2JbrQYEzIwMjIwMzMxMTAyMDU2LjYzNlowBIACAfSggdCkgc0wgcox +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJTAjBgNVBAsTHE1p +# Y3Jvc29mdCBBbWVyaWNhIE9wZXJhdGlvbnMxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOjEyQkMtRTNBRS03NEVCMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNloIIRVzCCBwwwggT0oAMCAQICEzMAAAGhAYVVmblUXYoAAQAAAaEw +# DQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwHhcN +# MjExMjAyMTkwNTI0WhcNMjMwMjI4MTkwNTI0WjCByjELMAkGA1UEBhMCVVMxEzAR +# BgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1p +# Y3Jvc29mdCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJpY2Eg +# T3BlcmF0aW9uczEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046MTJCQy1FM0FFLTc0 +# RUIxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2UwggIiMA0G +# CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDayTxe5WukkrYxxVuHLYW9BEWCD9kk +# jnnHsOKwGddIPbZlLY+l5ovLDNf+BEMQKAZQI3DX91l1yCDuP9X7tOPC48ZRGXA/ +# bf9ql0FK5438gIl7cV528XeEOFwc/A+UbIUfW296Omg8Z62xaQv3jrG4U/priArF +# /er1UA1HNuIGUyqjlygiSPwK2NnFApi1JD+Uef5c47kh7pW1Kj7RnchpFeY9MekP +# QRia7cEaUYU4sqCiJVdDJpefLvPT9EdthlQx75ldx+AwZf2a9T7uQRSBh8tpxPdI +# DDkKiWMwjKTrAY09A3I/jidqPuc8PvX+sqxqyZEN2h4GA0Edjmk64nkIukAK18K5 +# nALDLO9SMTxpAwQIHRDtZeTClvAPCEoy1vtPD7f+eqHqStuu+XCkfRjXEpX9+h9f +# rsB0/BgD5CBf3ELLAa8TefMfHZWEJRTPNrbXMKizSrUSkVv/3HP/ZsJpwaz5My2R +# byc3Ah9bT76eBJkyfT5FN9v/KQ0HnxhRMs6HHhTmNx+LztYci+vHf0D3QH1eCjZW +# ZRjp1mOyxpPU2mDMG6gelvJse1JzRADo7YIok/J3Ccbm8MbBbm85iogFltFHecHF +# EFwrsDGBFnNYHMhcbarQNA+gY2e2l9fAkX3MjI7Uklkoz74/P6KIqe5jcd9FPCbb +# SbYH9OLsteeYOQIDAQABo4IBNjCCATIwHQYDVR0OBBYEFBa/IDLbY475VQyKiZSw +# 47l0/cypMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8GA1UdHwRY +# MFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01p +# Y3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBsBggrBgEF +# BQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9w +# a2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAo +# MSkuY3J0MAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYIKwYBBQUHAwgwDQYJKoZI +# hvcNAQELBQADggIBACDDIxElfXlG5YKcKrLPSS+f3JWZprwKEiASvivaHTBRlXtA +# s+TkadcsEei+9w5vmF5tCUzTH4c0nCI7bZxnsL+S6XsiOs3Z1V4WX+IwoXUJ4zLv +# s0+mT4vjGDtYfKQ/bsmJKar2c99m/fHv1Wm2CTcyaePvi86Jh3UyLjdRILWbtzs4 +# oImFMwwKbzHdPopxrBhgi+C1YZshosWLlgzyuxjUl+qNg1m52MJmf11loI7D9HJo +# aQzd+rf928Y8rvULmg2h/G50o+D0UJ1Fa/cJJaHfB3sfKw9X6GrtXYGjmM3+g+Ah +# aVsfupKXNtOFu5tnLKvAH5OIjEDYV1YKmlXuBuhbYassygPFMmNgG2Ank3drEcDc +# ZhCXXqpRszNo1F6Gu5JCpQZXbOJM9Ue5PlJKtmImAYIGsw+pnHy/r5ggSYOp4g5Z +# 1oU9GhVCM3V0T9adee6OUXBk1rE4dZc/UsPlj0qoiljL+lN1A5gkmmz7k5tIObVG +# B7dJdz8J0FwXRE5qYu1AdvauVbZwGQkL1x8aK/svjEQW0NUyJ29znDHiXl5vLoRT +# jjFpshUBi2+IY+mNqbLmj24j5eT+bjDlE3HmNtLPpLcMDYqZ1H+6U6YmaiNmac2j +# RXDAaeEE/uoDMt2dArfJP7M+MDv3zzNNTINeuNEtDVgm9zwfgIUCXnDZuVtiMIIH +# cTCCBVmgAwIBAgITMwAAABXF52ueAptJmQAAAAAAFTANBgkqhkiG9w0BAQsFADCB +# iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1Jl +# ZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMp +# TWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTAwHhcNMjEw +# OTMwMTgyMjI1WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYDVQQGEwJVUzETMBEGA1UE +# CBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9z +# b2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQ +# Q0EgMjAxMDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOThpkzntHIh +# C3miy9ckeb0O1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDivbk+F2Az/1xPx2b3lVNx +# WuJ+Slr+uDZnhUYjDLWNE893MsAQGOhgfWpSg0S3po5GawcU88V29YZQ3MFEyHFc +# UTE3oAo4bo3t1w/YJlN8OWECesSq/XJprx2rrPY2vjUmZNqYO7oaezOtgFt+jBAc +# nVL+tuhiJdxqD89d9P6OU8/W7IVWTe/dvI2k45GPsjksUZzpcGkNyjYtcI4xyDUo +# veO0hyTD4MmPfrVUj9z6BVWYbWg7mka97aSueik3rMvrg0XnRm7KMtXAhjBcTyzi +# YrLNueKNiOSWrAFKu75xqRdbZ2De+JKRHh09/SDPc31BmkZ1zcRfNN0Sidb9pSB9 +# fvzZnkXftnIv231fgLrbqn427DZM9ituqBJR6L8FA6PRc6ZNN3SUHDSCD/AQ8rdH +# GO2n6Jl8P0zbr17C89XYcz1DTsEzOUyOArxCaC4Q6oRRRuLRvWoYWmEBc8pnol7X +# KHYC4jMYctenIPDC+hIK12NvDMk2ZItboKaDIV1fMHSRlJTYuVD5C4lh8zYGNRiE +# R9vcG9H9stQcxWv2XFJRXRLbJbqvUAV6bMURHXLvjflSxIUXk8A8FdsaN8cIFRg/ +# eKtFtvUeh17aj54WcmnGrnu3tz5q4i6tAgMBAAGjggHdMIIB2TASBgkrBgEEAYI3 +# FQEEBQIDAQABMCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSavoKRPEY1Kc8Q/y8E7jAd +# BgNVHQ4EFgQUn6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYDVR0gBFUwUzBRBgwrBgEE +# AYI3TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMBMGA1UdJQQMMAoGCCsGAQUFBwMI +# MBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1UdDwQEAwIBhjAPBgNVHRMB +# Af8EBTADAQH/MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjRPZSQW9fOmhjEMFYGA1Ud +# HwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2kvY3JsL3By +# b2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNybDBaBggrBgEFBQcBAQRO +# MEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2kvY2Vy +# dHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0GCSqGSIb3DQEBCwUAA4IC +# AQCdVX38Kq3hLB9nATEkW+Geckv8qW/qXBS2Pk5HZHixBpOXPTEztTnXwnE2P9pk +# bHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjYNi6cqYJWAAOwBb6J6Gng +# ugnue99qb74py27YP0h1AdkY3m2CDPVtI1TkeFN1JFe53Z/zjj3G82jfZfakVqr3 +# lbYoVSfQJL1AoL8ZthISEV09J+BAljis9/kpicO8F7BUhUKz/AyeixmJ5/ALaoHC +# gRlCGVJ1ijbCHcNhcy4sa3tuPywJeBTpkbKpW99Jo3QMvOyRgNI95ko+ZjtPu4b6 +# MhrZlvSP9pEB9s7GdP32THJvEKt1MMU0sHrYUP4KWN1APMdUbZ1jdEgssU5HLcEU +# BHG/ZPkkvnNtyo4JvbMBV0lUZNlz138eW0QBjloZkWsNn6Qo3GcZKCS6OEuabvsh +# VGtqRRFHqfG3rsjoiV5PndLQTHa1V1QJsWkBRH58oWFsc/4Ku+xBZj1p/cvBQUl+ +# fpO+y/g75LcVv7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue10CgaiQuPNtq6TPmb/wrp +# NPgkNWcr4A245oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6gMTN9vMvpe784cETRkPHI +# qzqKOghif9lwY1NNje6CbaUFEMFxBmoQtB1VM1izoXBm8qGCAs4wggI3AgEBMIH4 +# oYHQpIHNMIHKMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G +# A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUw +# IwYDVQQLExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25zMSYwJAYDVQQLEx1U +# aGFsZXMgVFNTIEVTTjoxMkJDLUUzQUUtNzRFQjElMCMGA1UEAxMcTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUAG3F2jO4LEMVLwgKG +# XdYMN4FBgOCggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu +# Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv +# cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDAN +# BgkqhkiG9w0BAQUFAAIFAOXvuD8wIhgPMjAyMjAzMzExMzE4NTVaGA8yMDIyMDQw +# MTEzMTg1NVowdzA9BgorBgEEAYRZCgQBMS8wLTAKAgUA5e+4PwIBADAKAgEAAgIP +# IwIB/zAHAgEAAgIRnzAKAgUA5fEJvwIBADA2BgorBgEEAYRZCgQCMSgwJjAMBgor +# BgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0GCSqGSIb3DQEBBQUA +# A4GBANc53MLryLt1FD+jkakQydkemUps4QiN8HJxJ36VPuc2XRhvcn0Fhp1Pi8Hk +# gg08sFJoJ2vT/9g5J39zdjQpnbNGMkfmEi+qT6hbGq0ta5rnt1wDG2pVMuMn7N2Q +# 8CytKi6ZynWVbiCNuQtxsuwdgM7bRwcf510Wwp7iQUeNjJZzMYIEDTCCBAkCAQEw +# gZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAGhAYVVmblUXYoA +# AQAAAaEwDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0B +# CRABBDAvBgkqhkiG9w0BCQQxIgQg7aLPwq2FhUC9oleuUeRc4uk9d+4UFLvls0ps +# 5tQU14wwgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCDrCFTxOoGCaCCCjoRy +# Be1JSQrMJeCCTyErziiJ347QhDCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABoQGFVZm5VF2KAAEAAAGhMCIEIOKn52EgS+EFhqx/FxY8 +# xYD6qqUYqtVZ3iZ47g3sjJRaMA0GCSqGSIb3DQEBCwUABIICACJi4QGIi9yhn8uf +# NlWbdGQNP0UkTWxJRMnAe4eQUYbcHoOxPxguwy7r8VfTZOdKBxfy7/LKo5XGmAo2 +# hmZSsLHjtT0zzkZti2AFeCRmZ8DMVaGfR9sWBr0OwlRS3HMDigpWyI5jP/tD529k +# jh0/BYwKg2TGRk6ZmdFWXuQf0lVb/LytEUyFbziq4hoxhKc4IQ3oCcOm1xaVZzbe +# SgzPg3j4QfHAucYgfxJoIUP1lKTRclmUc2ERYmHchaUxeYIdiDHx5lpEdNsh0acm +# LgV307ncxLeN1Ih2E6By+Dknm8OppqVYOSvcjcjqHY+fU7ci/FuvyUVDQv6xe2ZS +# K6qCMCrPWtoOlE3ms+LE5kHVQ1JOs0v7mVVP8xfO+fkArk3RuUl/1gaGxi5Ljheg +# l+51jV5PMM4Vha9KoWfU2306ZLt/I1Rftq1sCOD5ysLnhTQuInQMRpfXlY/rvTPu +# 9jzQ4q4Ty7WPp004gh+9hLIm0s0nmZmM8jyTRUFrK1SfHglBOKgdrcuJfmEuPKxL +# foRg/LzuUjcXvdtO3oozIaVWsTxGx6laY2DkMPnqYaj/oBwla86bNyQT94YTTGWq +# 3mCwt0/H4E3Mn1OXLVIGO3NrzZwTFFN2uqRmcTQ0AKiXU3ar4b8F/ykpQOvTV6x/ +# U7Jz/JaISbEvO3mUarzheUPqVmWq +# SIG # End signature block diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 new file mode 100644 index 000000000000..67107181add7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 @@ -0,0 +1,375 @@ +# +# Script module for module 'Az.Accounts' that is executed when 'Az.Accounts' is imported in a PowerShell session. +# +# Generated by: Microsoft Corporation +# +# Generated on: 03/31/2022 09:26:49 +# + +$PSDefaultParameterValues.Clear() +Set-StrictMode -Version Latest + +function Test-DotNet +{ + try + { + if ((Get-PSDrive 'HKLM' -ErrorAction Ignore) -and (-not (Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' -ErrorAction Stop | Get-ItemPropertyValue -ErrorAction Stop -Name Release | Where-Object { $_ -ge 461808 }))) + { + throw ".NET Framework versions lower than 4.7.2 are not supported in Az. Please upgrade to .NET Framework 4.7.2 or higher." + } + } + catch [System.Management.Automation.DriveNotFoundException] + { + Write-Verbose ".NET Framework version check failed." + } +} + +function Preload-Assembly { + param ( + [string] + $AssemblyDirectory + ) + if($PSEdition -eq 'Desktop' -and (Test-Path $AssemblyDirectory -ErrorAction Ignore)) + { + try + { + Get-ChildItem -ErrorAction Stop -Path $AssemblyDirectory -Filter "*.dll" | ForEach-Object { + try + { + Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose $_ + } + } + } + catch {} + } +} + +if ($true -and ($PSEdition -eq 'Desktop')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'5.1') + { + throw "PowerShell versions lower than 5.1 are not supported in Az. Please upgrade to PowerShell 5.1 or higher." + } + + Test-DotNet +} + +if ($true -and ($PSEdition -eq 'Core')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'6.2.4') + { + throw "Current Az version doesn't support PowerShell Core versions lower than 6.2.4. Please upgrade to PowerShell Core 6.2.4 or higher." + } + if ($PSVersionTable.PSVersion -lt [Version]'7.0.6') + { + Write-Warning "This version of Az.Accounts is only supported on Windows PowerShell 5.1 and PowerShell 7.0.6 or greater, open https://aka.ms/install-powershell to learn how to upgrade. For further information, go to https://aka.ms/azpslifecycle." + } +} + +if (Test-Path -Path "$PSScriptRoot\StartupScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\StartupScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +$preloadPath = (Join-Path $PSScriptRoot -ChildPath "PreloadAssemblies") +Preload-Assembly -AssemblyDirectory $preloadPath +$preloadPath = (Join-Path $PSScriptRoot -ChildPath "ModuleAlcAssemblies") +Preload-Assembly -AssemblyDirectory $preloadPath + +$netCorePath = (Join-Path $PSScriptRoot -ChildPath "NetCoreAssemblies") +if($PSEdition -eq 'Core' -and (Test-Path $netCorePath -ErrorAction Ignore)) +{ + try + { + $loadedAssemblies = ([System.AppDomain]::CurrentDomain.GetAssemblies() | ForEach-Object {New-Object -TypeName System.Reflection.AssemblyName -ArgumentList $_.FullName} ) + Get-ChildItem -ErrorAction Stop -Path $netCorePath -Filter "*.dll" | ForEach-Object { + $assemblyName = ([System.Reflection.AssemblyName]::GetAssemblyName($_.FullName)) + $matches = ($loadedAssemblies | Where-Object {$_.Name -eq $assemblyName.Name}) + if (-not $matches) + { + try + { + Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose $_ + } + } + } + } + catch {} +} + + +Import-Module (Join-Path -Path $PSScriptRoot -ChildPath Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll) + + +if (Test-Path -Path "$PSScriptRoot\PostImportScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\PostImportScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +$FilteredCommands = @() + +if ($Env:ACC_CLOUD -eq $null) +{ + $FilteredCommands | ForEach-Object { + + $existingDefault = $false + foreach ($key in $global:PSDefaultParameterValues.Keys) + { + if ($_ -like "$key") + { + $existingDefault = $true + } + } + + if (!$existingDefault) + { + $global:PSDefaultParameterValues.Add($_, + { + if ((Get-Command Get-AzContext -ErrorAction Ignore) -eq $null) + { + $context = Get-AzureRmContext + } + else + { + $context = Get-AzContext + } + if (($context -ne $null) -and $context.ExtendedProperties.ContainsKey("Default Resource Group")) { + $context.ExtendedProperties["Default Resource Group"] + } + }) + } + } +} + +# SIG # Begin signature block +# MIInugYJKoZIhvcNAQcCoIInqzCCJ6cCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBnXoRblwqGgp4a +# USzJaf5Wf+Tu+eUWmfecChJ7ENNasaCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjzCCGYsCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgqwm8h/dw +# FED0y+xGCWSaD8Fc1mZMgPkryh2zfSvZwxIwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQBvXNrKAkE7o84rJI6+XFvnA65dqlWCZBeFhG6YGpde +# Nom1mPdcfauabmxLKg7N5GG1FBWXuYDu1aEyDhiXzPG6ET+/ikXTGfN9J0D9g5Wx +# a2SeSIJ0XfsllBKKwOKl4OhoY3y5Kjjk08Cw75aE5BR8Ux0FWciN8n+nztakOyN9 +# tf7I5nmgbrHvJC5az2N9aR5DejRvjPDcNCnRkepz3nnA+FQNFbXaKqjgJz9oRBgA +# K2SAZDQnnK3B3MAv7qJX6GyeUhen7kwXZC0OV2RjyPRC+f8SiV/OF/ZsaFe4nXps +# RJqg5f5sUjCHFS5g8yK9Zy6D7EZKJJA4yk8YgRpdxOiuoYIXGTCCFxUGCisGAQQB +# gjcDAwExghcFMIIXAQYJKoZIhvcNAQcCoIIW8jCCFu4CAQMxDzANBglghkgBZQME +# AgEFADCCAVkGCyqGSIb3DQEJEAEEoIIBSASCAUQwggFAAgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIAn/Ph2Du7oUABZfi9Z4pWXxedNUse800UpCJBeG +# +id6AgZiF5hUHpsYEzIwMjIwMzMxMTAwMDEyLjU2OFowBIACAfSggdikgdUwgdIx +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1p +# Y3Jvc29mdCBJcmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhh +# bGVzIFRTUyBFU046RkM0MS00QkQ0LUQyMjAxJTAjBgNVBAMTHE1pY3Jvc29mdCBU +# aW1lLVN0YW1wIFNlcnZpY2WgghFoMIIHFDCCBPygAwIBAgITMwAAAY5Z20YAqBCU +# zAABAAABjjANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0Eg +# MjAxMDAeFw0yMTEwMjgxOTI3NDVaFw0yMzAxMjYxOTI3NDVaMIHSMQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQg +# SXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOkZDNDEtNEJENC1EMjIwMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqiMCq6OM +# zLa5wrtcf7Bf9f1WXW9kpqbOBzgPJvaGLrZG7twgwqTRWf1FkjpJKBOG5QPIRy7a +# 6IFVAy0W+tBaFX4In4DbBf2tGubyY9+hRU+hRewPJH5CYOvpPh77FfGM63+OlwRX +# p5YER6tC0WRKn3mryWpt4CwADuGv0LD2QjnhhgtRVidsiDnn9+aLjMuNapUhstGq +# Cr7JcQZt0ZrPUHW/TqTJymeU1eqgNorEbTed6UQyLaTVAmhXNQXDChfa526nW7RQ +# 7L4tXX9Lc0oguiCSkPlu5drNA6NM8z+UXQOAHxVfIQXmi+Y3SV2hr2dcxby9nlTz +# Yvf4ZDr5Wpcwt7tTdRIJibXHsXWMKrmOziliGDToLx34a/ctZE4NOLnlrKQWN9ZG +# +Ox5zRarK1EhShahM0uQNhb6BJjp3+c0eNzMFJ2qLZqDp2/3Yl5Q+4k+MDHLTipP +# 6VBdxcdVfd4mgrVTx3afO5KNfgMngGGfhSawGraRW28EhrLOspmIxii92E7vjncJ +# 2tcjhLCjBArVpPh3cZG5g3ZVy5iiAaoDaswpNgnMFAK5Un1reK+MFhPi9iMnvUPw +# tTDDJt5YED5DAT3mBUxp5QH3t7RhZwAJNLWLtpTeGF7ub81sSKYv2ardazAe9XLS +# 10tV2oOPrcniGJzlXW7VPvxqQNxe8lCDA20CAwEAAaOCATYwggEyMB0GA1UdDgQW +# BBTsQfkz9gT44N/5G8vNHayep+aV5DAfBgNVHSMEGDAWgBSfpxVdAF5iXYP05dJl +# pxtTNRnpcjBfBgNVHR8EWDBWMFSgUqBQhk5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIwMjAx +# MCgxKS5jcmwwbAYIKwYBBQUHAQEEYDBeMFwGCCsGAQUFBzAChlBodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY3Jvc29mdCUyMFRpbWUtU3Rh +# bXAlMjBQQ0ElMjAyMDEwKDEpLmNydDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoG +# CCsGAQUFBwMIMA0GCSqGSIb3DQEBCwUAA4ICAQA1UK9xzIeTlKhSbLn0bekR5gYh +# 6bB1XQpluCqCA15skZ37UilaFJw8+GklDLzlNhSP2mOiOzVyCq8kkpqnfUc01ZaB +# ezQxg77qevj2iMyg39YJfeiCIhxYOFugwepYrPO8MlB/oue/VhIiDb1eNYTlPSmv +# 3palsgtkrb0oo0F0uWmX4EQVGKRo0UENtZetVIxa0J9DpUdjQWPeEh9cEM+RgE26 +# 5w5WAVb+WNx0iWiF4iTbCmrWaVEOX92dNqBm9bT1U7nGwN5CygpNAgEaYnrTMx1N +# 4AjxObACDN5DdvGlu/O0DfMWVc6qk6iKDFC6WpXQSkMlrlXII/Nhp+0+noU6tfEp +# HKLt7fYm9of5i/QomcCwo/ekiOCjYktp393ovoC1O2uLtbLnMVlE5raBLBNSbINZ +# 6QLxiA41lXnVVLIzDihUL8MU9CMvG4sdbhk2FX8zvrsP5PeBIw1faenMZuz0V3UX +# CtU5Okx5fmioWiiLZSCi1ljaxX+BEwQiinCi+vE59bTYI5FbuR8tDuGLiVu/JSpV +# FXrzWMP2Kn11sCLAGEjqJYUmO1tRY29Kd7HcIj2niSB0PQOCjYlnCnywnDinqS1C +# XvRsisjVlS1Rp4Tmuks+pGxiMGzF58zcb+hoFKyONuL3b+tgxTAz3sF3BVX9uk9M +# 5F+OEoeyLyGfLekNAjCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUw +# DQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhv +# cml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +# ggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg +# 4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aO +# RmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41 +# JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5 +# LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL +# 64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9 +# QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj +# 0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqE +# UUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0 +# kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435 +# UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB +# 3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTE +# mr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwG +# A1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93 +# d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNV +# HSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNV +# HQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo +# 0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29m +# dC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5j +# cmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDAN +# BgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4 +# sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th54 +# 2DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRX +# ud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBew +# VIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0 +# DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+Cljd +# QDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFr +# DZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFh +# bHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7n +# tdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+ +# oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6Fw +# ZvKhggLXMIICQAIBATCCAQChgdikgdUwgdIxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046RkM0MS00QkQ0 +# LUQyMjAxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2WiIwoB +# ATAHBgUrDgMCGgMVAD1iK+pPThHqgpa5xsPmiYruWVuMoIGDMIGApH4wfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwDQYJKoZIhvcNAQEFBQACBQDl75AOMCIY +# DzIwMjIwMzMxMTAyNzI2WhgPMjAyMjA0MDExMDI3MjZaMHcwPQYKKwYBBAGEWQoE +# ATEvMC0wCgIFAOXvkA4CAQAwCgIBAAICAYUCAf8wBwIBAAICEiowCgIFAOXw4Y4C +# AQAwNgYKKwYBBAGEWQoEAjEoMCYwDAYKKwYBBAGEWQoDAqAKMAgCAQACAwehIKEK +# MAgCAQACAwGGoDANBgkqhkiG9w0BAQUFAAOBgQCCQ+gyinUAzBfQG0tdRLTKoWAz +# 1F9XL8HUl1+DL/nO5fnfNT2fIwdNtkcnjXkY7J89nDVJ5orczCc/Jjd8FWrGsZYF +# R7jTDpEnctly2mdeOC54DPn8NfB2rKnTAZSMNZUA5+qwXYtBJ9/L+zBcWbLJGn17 +# Xdsy6ogPG2mqiNeJETGCBA0wggQJAgEBMIGTMHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABjlnbRgCoEJTMAAEAAAGOMA0GCWCGSAFlAwQCAQUAoIIB +# SjAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwLwYJKoZIhvcNAQkEMSIEIBdm +# /Yr/algho7Se4sS1u0RA1CsQ3avLfVkP9cSuIl4vMIH6BgsqhkiG9w0BCRACLzGB +# 6jCB5zCB5DCBvQQgvQWPITvigaUuV5+f/lWs3BXZwJ/l1mf+yelu5nXmxCUwgZgw +# gYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD +# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAY5Z20YAqBCU +# zAABAAABjjAiBCDFYh4a5uyi794y1CHlKx3P8nxZO/8fomUMsnns7kvKmzANBgkq +# hkiG9w0BAQsFAASCAgCphAx90HI/vzWSwneRSNg3gV826YqxCNSVkzMDcu1Rkayq +# 3FhK466ELhIxyI9EL3hLCS/BIQYKH8AiVU85P07pmaLls+bUM2CPt3II0oZYY5T8 +# BN/MyqZ0vUS6QvNX8ZT8A82R5/meSt8qS8+8ppG1XumAYmdqv7vriD8ENBrhIyus +# 3Wjwt0rS2kovNj+6g3xMJBU+LnP+qzNv72aEr2LvKkU8/abYiNXN1FGlJPqHYrF/ +# zumVFsNkJMjJrlgRFlo/EROGu3iUiI37hM7mTm77aYrWoMbKrl/4nKfMpjR4KQqL +# Mhi9Cb1c11cugxCFnoc1IA6kQ+Xg1fYUchz5UmgzDTpwic3FVGGRlTv4Wf9PMjjj +# heZyL7BFkHZCpr5qpwpu/ZvpCSQpsP4Aa07qY5ffgRu/te0ip3gkzL3Ur7zNqf60 +# Dw9If1ECZOcx+GMgIHd0t+48+hsE4RrmvMvWrEBz2B/BJEOfrIQEClhFczLjDd4G +# nhh4y/vSlqbUUupH+/oJRtpla+ZQbAxsg8jTPsiGG7hmvSaNfV7+SgwCjO1HB/On +# DkzS+edyqivrfkuwjFYecbLcl9e9Pr3SPFvelW5kXiQw2KyWFrD0aznq7YT0x/Na +# /XaZDuLepRVe7YnvH4Ky7yk58zG3QYNy5EJ6Pf3ClNsX4BBAJsUrWMxicmpUDg== +# SIG # End signature block diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll new file mode 100644 index 000000000000..32652d6de4d0 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll new file mode 100644 index 000000000000..0d214db71cad Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 000000000000..f2955edfecb7 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..81b736cc09da Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..f656e5e42360 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll new file mode 100644 index 000000000000..6f2a3e0ad07f Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll new file mode 100644 index 000000000000..fe2154a3bf3a Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll new file mode 100644 index 000000000000..18a53248894f Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll new file mode 100644 index 000000000000..92d06762d6a5 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll new file mode 100644 index 000000000000..1c9d8e2a0ef5 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll new file mode 100644 index 000000000000..8e791611cc1a Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json new file mode 100644 index 000000000000..dde9337e5748 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json @@ -0,0 +1,2309 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll new file mode 100644 index 000000000000..fcc5eb26eb20 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json new file mode 100644 index 000000000000..7828816a6777 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json @@ -0,0 +1,2273 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll new file mode 100644 index 000000000000..511cf6f6e630 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json new file mode 100644 index 000000000000..ce563dfdebbe --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json @@ -0,0 +1,1316 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v2.1", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v2.1": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netcoreapp2.1/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.3.0", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "System.Collections/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": {}, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": {}, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": {}, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==", + "path": "microsoft.csharp/4.3.0", + "hashPath": "microsoft.csharp.4.3.0.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll new file mode 100644 index 000000000000..239999aa2f3c Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll new file mode 100644 index 000000000000..2b2e59f4a657 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll new file mode 100644 index 000000000000..d966f6c302c5 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll new file mode 100644 index 000000000000..2667669dd3f4 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll new file mode 100644 index 000000000000..a11687928f60 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll new file mode 100644 index 000000000000..78fd60ad7aeb Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll new file mode 100644 index 000000000000..b33058d94c53 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll new file mode 100644 index 000000000000..e07270d24805 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll new file mode 100644 index 000000000000..6f489252bcac Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll new file mode 100644 index 000000000000..c19efdb8e00b Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll new file mode 100644 index 000000000000..0d443a2ecaaa Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll new file mode 100644 index 000000000000..482ccf22b352 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll new file mode 100644 index 000000000000..4bf3ee9bd78d Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json new file mode 100644 index 000000000000..54274e52ee76 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json @@ -0,0 +1,2413 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Authentication.ResourceManager": "1.0.0", + "Microsoft.Azure.PowerShell.Authenticators": "1.0.0", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0", + "System.Security.Permissions": "4.5.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.AccessControl/4.5.0": { + "dependencies": { + "System.Security.Principal.Windows": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/System.Security.AccessControl.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Permissions/4.5.0": { + "dependencies": { + "System.Security.AccessControl": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Permissions.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Principal.Windows/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Security.Principal.Windows.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + }, + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll": {} + } + }, + "Microsoft.Azure.PowerShell.Authenticators/1.0.0": { + "dependencies": { + "Azure.Identity": "1.5.0", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authenticators.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.AccessControl/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vW8Eoq0TMyz5vAG/6ce483x/CP83fgm4SJe5P8Tb1tZaobcvPrbMEL7rhH1DRdrYbbb6F0vq3OlzmK0Pkwks5A==", + "path": "system.security.accesscontrol/4.5.0", + "hashPath": "system.security.accesscontrol.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.Permissions/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9gdyuARhUR7H+p5CjyUB/zPk7/Xut3wUSP8NJQB6iZr8L3XUXTMdoLeVAg9N4rqF8oIpE7MpdqHdDHQ7XgJe0g==", + "path": "system.security.permissions/4.5.0", + "hashPath": "system.security.permissions.4.5.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", + "path": "system.security.principal.windows/4.5.0", + "hashPath": "system.security.principal.windows.4.5.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Azure.PowerShell.Authenticators/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll new file mode 100644 index 000000000000..2eff02a0138e Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml new file mode 100644 index 000000000000..85f85750523b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml @@ -0,0 +1,11900 @@ + + + + + Add-AzEnvironment + Add + AzEnvironment + + Adds endpoints and metadata for an instance of Azure Resource Manager. + + + + The Add-AzEnvironment cmdlet adds endpoints and metadata to enable Azure Resource Manager cmdlets to connect with a new instance of Azure Resource Manager. The built-in environments AzureCloud and AzureChinaCloud target existing public instances of Azure Resource Manager. + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + AutoDiscover + + Discovers environments via default or configured endpoint. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AutoDiscover + + Discovers environments via default or configured endpoint. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : +VersionProfiles : {} +ExtendedProperties : {} +BatchEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + ------- Example 2: Discovering a new environment via Uri ------- + <# +Uri https://configuredmetadata.net returns an array of environment metadata. The following example contains a payload for the AzureCloud default environment. + +[ + { + "portal": "https://portal.azure.com", + "authentication": { + "loginEndpoint": "https://login.microsoftonline.com/", + "audiences": [ + "https://management.core.windows.net/" + ], + "tenant": "common", + "identityProvider": "AAD" + }, + "media": "https://rest.media.azure.net", + "graphAudience": "https://graph.windows.net/", + "graph": "https://graph.windows.net/", + "name": "AzureCloud", + "suffixes": { + "azureDataLakeStoreFileSystem": "azuredatalakestore.net", + "acrLoginServer": "azurecr.io", + "sqlServerHostname": ".database.windows.net", + "azureDataLakeAnalyticsCatalogAndJob": "azuredatalakeanalytics.net", + "keyVaultDns": "vault.azure.net", + "storage": "core.windows.net", + "azureFrontDoorEndpointSuffix": "azurefd.net" + }, + "batch": "https://batch.core.windows.net/", + "resourceManager": "https://management.azure.com/", + "vmImageAliasDoc": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json", + "activeDirectoryDataLake": "https://datalake.azure.net/", + "sqlManagement": "https://management.core.windows.net:8443/", + "gallery": "https://gallery.azure.com/" + }, +…… +] +#> + +Add-AzEnvironment -AutoDiscover -Uri https://configuredmetadata.net + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + In this example, we are discovering a new Azure environment from the `https://configuredmetadata.net` Uri. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/add-azenvironment + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Clear-AzContext + Clear + AzContext + + Remove all Azure credentials, account, and subscription information. + + + + Remove all Azure Credentials, account, and subscription information. + + + + Clear-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + --------------- Example 1: Clear global context --------------- + Clear-AzContext -Scope CurrentUser + + Remove all account, subscription, and credential information for any powershell session. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/clear-azcontext + + + + + + Clear-AzDefault + Clear + AzDefault + + Clears the defaults set by the user in the current context. + + + + The Clear-AzDefault cmdlet removes the defaults set by the user depending on the switch parameters specified by the user. + + + + Clear-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Clear-AzDefault + + This command removes all the defaults set by the user in the current context. + + + + + + -------------------------- Example 2 -------------------------- + Clear-AzDefault -ResourceGroup + + This command removes the default resource group set by the user in the current context. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/clear-azdefault + + + + + + Connect-AzAccount + Connect + AzAccount + + Connect to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. + + + + The `Connect-AzAccount` cmdlet connects to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. You can use this authenticated account only with Azure Resource Manager requests. To add an authenticated account for use with Service Management, use the `Add-AzureAccount` cmdlet from the Azure PowerShell module. If no context is found for the current user, the user's context list is populated with a context for each of their first 25 subscriptions. The list of contexts created for the user can be found by running `Get-AzContext -ListAvailable`. To skip this context population, specify the SkipContextPopulation switch parameter. After executing this cmdlet, you can disconnect from an Azure account using `Disconnect-AzAccount`. + + + + Connect-AzAccount + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + Identity + + Login using a Managed Service Identity. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + Identity + + Login using a Managed Service Identity. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------------ Example 1: Connect to an Azure account ------------ + Connect-AzAccount + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 2: Connect to Azure using organizational ID credentials + $Credential = Get-Credential +Connect-AzAccount -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 3: Connect to Azure using a service principal account + $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ApplicationId, $SecuredPassword +Connect-AzAccount -ServicePrincipal -TenantId $TenantId -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxx-xxxx-xxxx-xxxx Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 4: Use an interactive login to connect to a specific tenant and subscription + Connect-AzAccount -Tenant 'xxxx-xxxx-xxxx-xxxx' -SubscriptionId 'yyyy-yyyy-yyyy-yyyy' + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ----- Example 5: Connect using a Managed Service Identity ----- + Connect-AzAccount -Identity + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +MSI@50342 Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 6: Connect using Managed Service Identity login and ClientId + $identity = Get-AzUserAssignedIdentity -ResourceGroupName 'myResourceGroup' -Name 'myUserAssignedIdentity' +Get-AzVM -ResourceGroupName contoso -Name testvm | Update-AzVM -IdentityType UserAssigned -IdentityId $identity.Id +Connect-AzAccount -Identity -AccountId $identity.ClientId # Run on the virtual machine + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ------------ Example 7: Connect using certificates ------------ + $Thumbprint = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = '00000000-0000-0000-0000-00000000' +Connect-AzAccount -CertificateThumbprint $Thumbprint -ApplicationId $ApplicationId -Tenant $TenantId -ServicePrincipal + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + +Account : xxxxxxxx-xxxx-xxxx-xxxxxxxx +SubscriptionName : MyTestSubscription +SubscriptionId : zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz +TenantId : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy +Environment : AzureCloud + + + + + + + + -------------- Example 8: Connect with AuthScope -------------- + Connect-AzAccount -AuthScope Storage + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ---------- Example 9: Connect using certificate file ---------- + $securePassword = $plainPassword | ConvertTo-SecureString -AsPlainText -Force +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz' +Connect-AzAccount -ServicePrincipal -ApplicationId $ApplicationId -TenantId $TenantId -CertificatePath './certificatefortest.pfx' -CertificatePassword $securePassword + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/connect-azaccount + + + + + + Disable-AzContextAutosave + Disable + AzContextAutosave + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Disable-AzContextAutosave + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ---------- Example 1: Disable autosaving the context ---------- + Disable-AzContextAutosave + + Disable autosave for the current user. + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Disable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azcontextautosave + + + + + + Disable-AzDataCollection + Disable + AzDataCollection + + Opts out of collecting data to improve the Azure PowerShell cmdlets. Data is collected by default unless you explicitly opt out. + + + + The `Disable-AzDataCollection` cmdlet is used to opt out of data collection. Azure PowerShell automatically collects telemetry data by default. To disable data collection, you must explicitly opt-out. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. If you've previously opted out, run the `Enable-AzDataCollection` cmdlet to re-enable data collection for the current user on the current machine. + + + + Disable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -- Example 1: Disabling data collection for the current user -- + Disable-AzDataCollection + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azdatacollection + + + Enable-AzDataCollection + + + + + + + Disable-AzureRmAlias + Disable + AzureRmAlias + + Disables AzureRm prefix aliases for Az modules. + + + + Disables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases disabled. Otherwise all AzureRm aliases are disabled. + + + + Disable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Disable-AzureRmAlias + + Disables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Disable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Disables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azurermalias + + + + + + Disconnect-AzAccount + Disconnect + AzAccount + + Disconnects a connected Azure account and removes all credentials and contexts associated with that account. + + + + The Disconnect-AzAccount cmdlet disconnects a connected Azure account and removes all credentials and contexts (subscription and tenant information) associated with that account. After executing this cmdlet, you will need to login again using Connect-AzAccount. + + + + Disconnect-AzAccount + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + + + + + + + ----------- Example 1: Logout of the current account ----------- + Disconnect-AzAccount + + Logs out of the Azure account associated with the current context. + + + + + + Example 2: Logout of the account associated with a particular context + Get-AzContext "Work" | Disconnect-AzAccount -Scope CurrentUser + + Logs out the account associated with the given context (named 'Work'). Because this uses the 'CurrentUser' scope, all credentials and contexts will be permanently deleted. + + + + + + ------------- Example 3: Log out a particular user ------------- + Disconnect-AzAccount -Username 'user1@contoso.org' + + Logs out the 'user1@contoso.org' user - all credentials and all contexts associated with this user will be removed. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disconnect-azaccount + + + + + + Enable-AzContextAutosave + Enable + AzContextAutosave + + Azure contexts are PowerShell objects representing your active subscription to run commands against, and the authentication information needed to connect to an Azure cloud. With Azure contexts, Azure PowerShell doesn't need to reauthenticate your account each time you switch subscriptions. For more information, see Azure PowerShell context objects (https://docs.microsoft.com/powershell/azure/context-persistence). + This cmdlet allows the Azure context information to be saved and automatically loaded when you start a PowerShell process. For example, when opening a new window. + + + + Allows the Azure context information to be saved and automatically loaded when a PowerShell process starts. The context is saved at the end of the execution of any cmdlet that affects the context. For example, any profile cmdlet. If you're using user authentication, then tokens can be updated during the course of running any cmdlet. + + + + Enable-AzContextAutosave + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + Example 1: Enable autosaving credentials for the current user + Enable-AzContextAutosave + + + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Enable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azcontextautosave + + + + + + Enable-AzDataCollection + Enable + AzDataCollection + + Enables Azure PowerShell to collect data to improve the user experience with the Azure PowerShell cmdlets. Executing this cmdlet opts in to data collection for the current user on the current machine. Data is collected by default unless you explicitly opt out. + + + + The `Enable-AzDataCollection` cmdlet is used to opt in to data collection. Azure PowerShell automatically collects telemetry data by default. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. To disable data collection, you must explicitly opt out by executing `Disable-AzDataCollection`. + + + + Enable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + --- Example 1: Enabling data collection for the current user --- + Enable-AzDataCollection + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azdatacollection + + + Disable-AzDataCollection + + + + + + + Enable-AzureRmAlias + Enable + AzureRmAlias + + Enables AzureRm prefix aliases for Az modules. + + + + Enables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases enabled. Otherwise all AzureRm aliases are enabled. + + + + Enable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + + Local + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Enable-AzureRmAlias + + Enables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Enable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Enables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azurermalias + + + + + + Get-AzAccessToken + Get + AzAccessToken + + Get raw access token. When using -ResourceUrl, please make sure the value does match current Azure environment. You may refer to the value of `(Get-AzContext).Environment`. + + + + Get access token + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + System.String + + System.String + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + + + + + + + + ------- Example 1 Get the access token for ARM endpoint ------- + Get-AzAccessToken + + Get access token of current account for ResourceManager endpoint + + + + + + - Example 2 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceTypeName MSGraph + + Get access token of Microsoft Graph endpoint for current account + + + + + + - Example 3 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceUrl "https://graph.microsoft.com/" + + Get access token of Microsoft Graph endpoint for current account + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azaccesstoken + + + + + + Get-AzContext + Get + AzContext + + Gets the metadata used to authenticate Azure Resource Manager requests. + + + + The Get-AzContext cmdlet gets the current metadata used to authenticate Azure Resource Manager requests. This cmdlet gets the Active Directory account, Active Directory tenant, Azure subscription, and the targeted Azure environment. Azure Resource Manager cmdlets use these settings by default when making Azure Resource Manager requests. When the available amount of subscription exceeds the default limit of 25, some subscriptions may not show up in the results of `Get-AzContext -ListAvailable`. Please run `Connect-AzAccount -MaxContextPopulation <int>` to get more contexts. + + + + Get-AzContext + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + + System.Management.Automation.SwitchParameter + + + False + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + + System.Management.Automation.SwitchParameter + + + False + + + + Get-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + The name of the context + + System.String + + System.String + + + None + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------------ Example 1: Getting the current context ------------ + Connect-AzAccount +Get-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + In this example we are logging into our account with an Azure subscription using Connect-AzAccount, and then we are getting the context of the current session by calling Get-AzContext. + + + + + + ---------- Example 2: Listing all available contexts ---------- + Get-AzContext -ListAvailable + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... +Subscription2 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription2 AzureCloud xxxxxxxx-x... +Subscription3 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription3 AzureCloud xxxxxxxx-x... + + In this example, all currently available contexts are displayed. The user may select one of these contexts using Select-AzContext. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azcontext + + + Set-AzContext + + + + Connect-AzAccount + + + + + + + Get-AzContextAutosaveSetting + Get + AzContextAutosaveSetting + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Get-AzContextAutosaveSetting + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ------ Get context save metadata for the current session ------ + Get-AzContextAutosaveSetting + +Mode : Process +ContextDirectory : None +ContextFile : None +CacheDirectory : None +CacheFile : None +Settings : {} + + Get details about whether and where the context is saved. In the above example, the autosave feature has been disabled. + + + + + + -------- Get context save metadata for the current user -------- + Get-AzContextAutosaveSetting -Scope CurrentUser + +Mode : CurrentUser +ContextDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +ContextFile : AzureRmContext.json +CacheDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +CacheFile : TokenCache.dat +Settings : {} + + Get details about whether and where the context is saved by default for the current user. Note that this may be different than the settings that are active in the current session. In the above example, the autosave feature has been enabled, and data is saved to the default location. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azcontextautosavesetting + + + + + + Get-AzDefault + Get + AzDefault + + Get the defaults set by the user in the current context. + + + + The Get-AzDefault cmdlet gets the Resource Group that the user has set as default in the current context. + + + + Get-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Get-AzDefault + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current defaults if there are defaults set, or returns nothing if no default is set. + + + + + + -------------------------- Example 2 -------------------------- + Get-AzDefault -ResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current default Resource Group if there is a default set, or returns nothing if no default is set. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azdefault + + + + + + Get-AzEnvironment + Get + AzEnvironment + + Get endpoints and metadata for an instance of Azure services. + + + + The Get-AzEnvironment cmdlet gets endpoints and metadata for an instance of Azure services. + + + + Get-AzEnvironment + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ---------- Example 1: Getting all Azure environments ---------- + Get-AzEnvironment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in +AzureGermanCloud https://management.microsoftazure.de/ https://login.microsoftonline.de/ Built-in +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in +AzureChinaCloud https://management.chinacloudapi.cn/ https://login.chinacloudapi.cn/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + -------- Example 2: Getting the AzureCloud environment -------- + Get-AzEnvironment -Name AzureCloud + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + ------ Example 3: Getting the AzureChinaCloud environment ------ + Get-AzEnvironment -Name AzureChinaCloud | Format-List + +Name : AzureChinaCloud +Type : Built-in +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : https://management.core.chinacloudapi.cn/ +AdTenant : Common +GalleryUrl : https://gallery.azure.com/ +ManagementPortalUrl : https://go.microsoft.com/fwlink/?LinkId=301902 +ServiceManagementUrl : https://management.core.chinacloudapi.cn/ +PublishSettingsFileUrl : https://go.microsoft.com/fwlink/?LinkID=301776 +ResourceManagerUrl : https://management.chinacloudapi.cn/ +SqlDatabaseDnsSuffix : .database.chinacloudapi.cn +StorageEndpointSuffix : core.chinacloudapi.cn +ActiveDirectoryAuthority : https://login.chinacloudapi.cn/ +GraphUrl : https://graph.chinacloudapi.cn/ +GraphEndpointResourceId : https://graph.chinacloudapi.cn/ +TrafficManagerDnsSuffix : trafficmanager.cn +AzureKeyVaultDnsSuffix : vault.azure.cn +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : https://vault.azure.cn +ContainerRegistryEndpointSuffix : azurecr.cn +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : asazure.chinacloudapi.cn +AnalysisServicesEndpointResourceId : https://region.asazure.chinacloudapi.cn +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : dev.azuresynapse.azure.cn +AzureSynapseAnalyticsEndpointResourceId : https://dev.azuresynapse.azure.cn + + This example shows how to get the endpoints and metadata for the AzureChinaCloud environment. + + + + + + ----- Example 4: Getting the AzureUSGovernment environment ----- + Get-AzEnvironment -Name AzureUSGovernment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in + + This example shows how to get the endpoints and metadata for the AzureUSGovernment environment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azenvironment + + + Add-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Get-AzSubscription + Get + AzSubscription + + Get subscriptions that the current account can access. + + + + The Get-AzSubscription cmdlet gets the subscription ID, subscription name, and home tenant for subscriptions that the current account can access. + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + + + + + ------- Example 1: Get all subscriptions in all tenants ------- + Get-AzSubscription + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled +Subscription3 zzzz-zzzz-zzzz-zzzz bbbb-bbbb-bbbb-bbbb Enabled + + This command gets all subscriptions in all tenants that are authorized for the current account. + + + + + + ---- Example 2: Get all subscriptions for a specific tenant ---- + Get-AzSubscription -TenantId "aaaa-aaaa-aaaa-aaaa" + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + List all subscriptions in the given tenant that are authorized for the current account. + + + + + + ---- Example 3: Get all subscriptions in the current tenant ---- + Get-AzSubscription + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + This command gets all subscriptions in the current tenant that are authorized for the current user. + + + + + + Example 4: Change the current context to use a specific subscription + Get-AzSubscription -SubscriptionId "xxxx-xxxx-xxxx-xxxx" -TenantId "yyyy-yyyy-yyyy-yyyy" | Set-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxx-xxxx-xxxx-xxxx) azureuser@micros... Subscription1 AzureCloud yyyy-yyyy-yyyy-yyyy + + This command gets the specified subscription, and then sets the current context to use it. All subsequent cmdlets in this session use the new subscription (Contoso Subscription 1) by default. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azsubscription + + + + + + Get-AzTenant + Get + AzTenant + + Gets tenants that are authorized for the current user. + + + + The Get-AzTenant cmdlet gets tenants authorized for the current user. + + + + Get-AzTenant + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + + + + + + + ---------------- Example 1: Getting all tenants ---------------- + Connect-AzAccount +Get-AzTenant + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} +yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy Testhost Home testhost.onmicrosoft.com + + This example shows how to get all of the authorized tenants of an Azure account. + + + + + + ------------- Example 2: Getting a specific tenant ------------- + Connect-AzAccount +Get-AzTenant -TenantId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} + + This example shows how to get a specific authorized tenant of an Azure account. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-aztenant + + + + + + Import-AzContext + Import + AzContext + + Loads Azure authentication information from a file. + + + + The Import-AzContext cmdlet loads authentication information from a file to set the Azure environment and context. Cmdlets that you run in the current session use this information to authenticate requests to Azure Resource Manager. + + + + Import-AzContext + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Import-AzContext + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ----- Example 1: Importing a context from a AzureRmProfile ----- + Import-AzContext -AzContext (Connect-AzAccount) + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example imports a context from a PSAzureProfile that is passed through to the cmdlet. + + + + + + ------- Example 2: Importing a context from a JSON file ------- + Import-AzContext -Path C:\test.json + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example selects a context from a JSON file that is passed through to the cmdlet. This JSON file can be created from Save-AzContext. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/import-azcontext + + + + + + Invoke-AzRestMethod + Invoke + AzRestMethod + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Invoke-AzRestMethod + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.string + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSHttpResponse + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Invoke-AzRestMethod -Path "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}?api-version={API}" -Method GET + +Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [x-ms-request-id, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : { + "properties": { + "source": "Azure", + "customerId": "{customerId}", + "provisioningState": "Succeeded", + "sku": { + "name": "pergb2018", + "maxCapacityReservationLevel": 3000, + "lastSkuUpdate": "Mon, 25 May 2020 11:10:01 GMT" + }, + "retentionInDays": 30, + "features": { + "legacy": 0, + "searchVersion": 1, + "enableLogAccessUsingOnlyResourcePermissions": true + }, + "workspaceCapping": { + "dailyQuotaGb": -1.0, + "quotaNextResetTime": "Thu, 18 Jun 2020 05:00:00 GMT", + "dataIngestionStatus": "RespectQuota" + }, + "enableFailover": false, + "publicNetworkAccessForIngestion": "Enabled", + "publicNetworkAccessForQuery": "Enabled", + "createdDate": "Mon, 25 May 2020 11:10:01 GMT", + "modifiedDate": "Mon, 25 May 2020 11:10:02 GMT" + }, + "id": "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}", + "name": "{workspace}", + "type": "Microsoft.OperationalInsights/workspaces", + "location": "eastasia", + "tags": {} + } + + Get log analytics workspace by path. It only supports management plane API and Hostname of Azure Resource Manager is added according to Azure environment setting. + + + + + + + -------------------------- Example 2 -------------------------- + Invoke-AzRestMethod https://graph.microsoft.com/v1.0/me + +Headers : {[Date, System.String[]], [Cache-Control, System.String[]], [Transfer-Encoding, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : {"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity","businessPhones":["......} + + Get current signed in user via MicrosoftGraph API. This example is equivalent to `Get-AzADUser -SignedIn`. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/invoke-azrestmethod + + + + + + Open-AzSurveyLink + Open + AzSurveyLink + + Open survey link in default browser. + + + + Open survey link in default browser. + + + + Open-AzSurveyLink + + + + + + + None + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Open-AzSurveyLink + +Opening the default browser to https://aka.ms/azpssurvey?Q_CHL=INTERCEPT + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/open-azsurveylink + + + + + + Register-AzModule + Register + AzModule + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + Register-AzModule + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Register-AzModule + + Used Internally by AutoRest-generated cmdlets + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/register-azmodule + + + + + + Remove-AzContext + Remove + AzContext + + Remove a context from the set of available contexts + + + + Remove an azure context from the set of contexts + + + + Remove-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Remove-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + PassThru + + Return the removed context + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Remove-AzContext -Name Default + + Remove the context named default + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/remove-azcontext + + + + + + Remove-AzEnvironment + Remove + AzEnvironment + + Removes endpoints and metadata for connecting to a given Azure instance. + + + + The Remove-AzEnvironment cmdlet removes endpoints and metadata information for connecting to a given Azure instance. + + + + Remove-AzEnvironment + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and removing a test environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Remove-AzEnvironment -Name TestEnvironment + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + This example shows how to create an environment using Add-AzEnvironment, and then how to delete the environment using Remove-AzEnvironment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/remove-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Rename-AzContext + Rename + AzContext + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename-AzContext + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Rename-AzContext + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------ Example 1: Rename a context using named parameters ------ + Rename-AzContext -SourceName "[user1@contoso.org; 12345-6789-2345-3567890]" -TargetName "Work" + + Rename the context for 'user1@contoso.org' with subscription '12345-6789-2345-3567890' to 'Work'. After this command, you will be able to target the context using 'Select-AzContext Work'. Note that you can tab through the values for 'SourceName' using tab completion. + + + + + + --- Example 2: Rename a context using positional parameters --- + Rename-AzContext "My context" "Work" + + Rename the context named "My context" to "Work". After this command, you will be able to target the context using Select-AzContext Work + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/rename-azcontext + + + + + + Resolve-AzError + Resolve + AzError + + Display detailed information about PowerShell errors, with extended details for Azure PowerShell errors. + + + + Resolves and displays detailed information about errors in the current PowerShell session, including where the error occurred in script, stack trace, and all inner and aggregate exceptions. For Azure PowerShell errors provides additional detail in debugging service issues, including complete detail about the request and server response that caused the error. + + + + Resolve-AzError + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + Resolve-AzError + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Last + + Resolve only the last error that occurred in the session. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + Last + + Resolve only the last error that occurred in the session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.ErrorRecord[] + + + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + + + + + + + + + -------------- Example 1: Resolve the Last Error -------------- + Resolve-AzError -Last + +HistoryId: 3 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in AzureRmCmdlet.cs:line 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() inAzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 3 + + Get details of the last error. + + + + + + --------- Example 2: Resolve all Errors in the Session --------- + Resolve-AzError + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + + HistoryId: 5 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in C:\zd\azur + e-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in + C:\zd\azure-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:lin + e 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in C:\zd\azure-p + owershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in C:\zd\azure- + powershell\src\ResourceManager\Profile\Commands.Profile\Subscription\GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 5 + + Get details of all errors that have occurred in the current session. + + + + + + ------------- Example 3: Resolve a Specific Error ------------- + Resolve-AzError $Error[0] + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + Get details of the specified error. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/resolve-azerror + + + + + + Save-AzContext + Save + AzContext + + Saves the current authentication information for use in other PowerShell sessions. + + + + The Save-AzContext cmdlet saves the current authentication information for use in other PowerShell sessions. + + + + Save-AzContext + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------- Example 1: Saving the current session's context ------- + Connect-AzAccount +Save-AzContext -Path C:\test.json + + This example saves the current session's Azure context to the JSON file provided. + + + + + + -------------- Example 2: Saving a given context -------------- + Save-AzContext -Profile (Connect-AzAccount) -Path C:\test.json + + This example saves the Azure context that is passed through to the cmdlet to the JSON file provided. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/save-azcontext + + + + + + Select-AzContext + Select + AzContext + + Select a subscription and account to target in Azure PowerShell cmdlets + + + + Select a subscription to target (or account or tenant) in Azure PowerShell cmdlets. After this cmdlet, future cmdlets will target the selected context. + + + + Select-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Select-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------- Example 1: Target a named context -------------- + Select-AzContext "Work" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + Target future Azure PowerShell cmdlets at the account, tenant, and subscription in the 'Work' context. + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Select-AzContext -Name TestEnvironment -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/select-azcontext + + + + + + Send-Feedback + Send + Feedback + + Sends feedback to the Azure PowerShell team via a set of guided prompts. + + + + The Send-Feedback cmdlet sends feedback to the Azure PowerShell team. + + + + Send-Feedback + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -------------------------- Example 1: -------------------------- + Send-Feedback + +With zero (0) being the least and ten (10) being the most, how likely are you to recommend Azure PowerShell to a friend or colleague? + +10 + +What does Azure PowerShell do well? + +Response. + +Upon what could Azure PowerShell improve? + +Response. + +Please enter your email if you are interested in providing follow up information: + +your@email.com + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/send-feedback + + + + + + Set-AzContext + Set + AzContext + + Sets the tenant, subscription, and environment for cmdlets to use in the current session. + + + + The Set-AzContext cmdlet sets authentication information for cmdlets that you run in the current session. The context includes tenant, subscription, and environment information. + + + + Set-AzContext + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ----------- Example 1: Set the subscription context ----------- + Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + This command sets the context to use the specified subscription. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azcontext + + + Get-AzContext + + + + + + + Set-AzDefault + Set + AzDefault + + Sets a default in the current context + + + + The Set-AzDefault cmdlet adds or changes the defaults in the current context. + + + + Set-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Set-AzDefault -ResourceGroupName myResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command sets the default resource group to the resource group specified by the user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azdefault + + + + + + Set-AzEnvironment + Set + AzEnvironment + + Sets properties for an Azure environment. + + + + The Set-AzEnvironment cmdlet sets endpoints and metadata for connecting to an instance of Azure. + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +BatchEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureOperationalInsightsEndpointResourceId : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + + + + Uninstall-AzureRm + Uninstall + AzureRm + + Removes all AzureRm modules from a machine. + + + + Removes all AzureRm modules from a machine. + + + + Uninstall-AzureRm + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Uninstall-AzureRm + + Running this command will remove all AzureRm modules from the machine for the version of PowerShell in which the cmdlet is run. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/uninstall-azurerm + + + + \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll new file mode 100644 index 000000000000..e45ac91a1264 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll new file mode 100644 index 000000000000..a705c3fd25a8 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll new file mode 100644 index 000000000000..f15127c61779 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll new file mode 100644 index 000000000000..f82770a9ceed Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll new file mode 100644 index 000000000000..1d99c7015912 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll new file mode 100644 index 000000000000..4b4be00999a4 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll new file mode 100644 index 000000000000..6ac672abd486 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll new file mode 100644 index 000000000000..70c5ed6806c6 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 new file mode 100644 index 000000000000..bb0bc9e63f5d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 @@ -0,0 +1,219 @@ +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } catch {} +} +# SIG # Begin signature block +# MIInugYJKoZIhvcNAQcCoIInqzCCJ6cCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBn8ROze2QLH/c6 +# GtPhR/BPLgOtmjkNhcq+fFmu16VcrqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjzCCGYsCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgLwxfLTEa +# f5cZ43nGFJSGxV1AZMu24c5Ln5TdSBDWTncwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCH+MB7uS3RlpbV8q8Nvg9aa0UmWWYCFOT/3n7V09Q6 +# p3v/uFdZ8AXCe8zdAeWFwLOQg9974QcDbIbvXm1V96+Z7zEEimU/Zr1ou5Cv0knI +# riaKdejplgnDt1EnBE9JlSyVsV7aOYr4EueMCb1Xn1dfGabKcgVlJUlP0JyZPQfs +# YqsyxEznkgNE769m8ozUwCx33jJN1Llcs3FYEe5irzu8UthSkFQ8vpG3YABhlk6M +# 4jPeb38LKbkEE0jclq6sfdmT+JL8j7Z05KfgaD076LnpSaqkcu9+2RH3TARosqhq +# I/N3nhDQclKIl1kYSXFG1E4/6ea3rAa98adIaR0YNcpFoYIXGTCCFxUGCisGAQQB +# gjcDAwExghcFMIIXAQYJKoZIhvcNAQcCoIIW8jCCFu4CAQMxDzANBglghkgBZQME +# AgEFADCCAVkGCyqGSIb3DQEJEAEEoIIBSASCAUQwggFAAgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIDsI/xX4lqk74CTV97lUQ0iyAOiIu4ggTwVzbGvl +# +HKeAgZiMTFcH0UYEzIwMjIwMzMxMTAwMDA5LjQ1OVowBIACAfSggdikgdUwgdIx +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1p +# Y3Jvc29mdCBJcmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhh +# bGVzIFRTUyBFU046QTI0MC00QjgyLTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBU +# aW1lLVN0YW1wIFNlcnZpY2WgghFoMIIHFDCCBPygAwIBAgITMwAAAY16VS54dJkq +# twABAAABjTANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0Eg +# MjAxMDAeFw0yMTEwMjgxOTI3NDVaFw0yMzAxMjYxOTI3NDVaMIHSMQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQg +# SXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOkEyNDAtNEI4Mi0xMzBFMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2jRILZg+ +# O6U7dLcuwBPMB+0tJUz0wHLqJ5f7KJXQsTzWToADUMYV4xVZnp9mPTWojUJ/l3O4 +# XqegLDNduFAObcitrLyY5HDsxAfUG1/2YilcSkSP6CcMqWfsSwULGX5zlsVKHJ7t +# vwg26y6eLklUdFMpiq294T4uJQdXd5O7mFy0vVkaGPGxNWLbZxKNzqKtFnWQ7jMt +# Z05XvafkIWZrNTFv8GGpAlHtRsZ1A8KDo6IDSGVNZZXbQs+fOwMOGp/Bzod8f1YI +# 8Gb2oN/mx2ccvdGr9la55QZeVsM7LfTaEPQxbgAcLgWDlIPcmTzcBksEzLOQsSpB +# zsqPaWI9ykVw5ofmrkFKMbpQT5EMki2suJoVM5xGgdZWnt/tz00xubPSKFi4B4IM +# FUB9mcANUq9cHaLsHbDJ+AUsVO0qnVjwzXPYJeR7C/B8X0Ul6UkIdplZmncQZSBK +# 3yZQy+oGsuJKXFAq3BlxT6kDuhYYvO7itLrPeY0knut1rKkxom+ui6vCdthCfnAi +# yknyRC2lknqzz8x1mDkQ5Q6Ox9p6/lduFupSJMtgsCPN9fIvrfppMDFIvRoULsHO +# dLJjrRli8co5M+vZmf20oTxYuXzM0tbRurEJycB5ZMbwznsFHymOkgyx8OeFnXV3 +# car45uejI1B1iqUDbeSNxnvczuOhcpzwackCAwEAAaOCATYwggEyMB0GA1UdDgQW +# BBR4zJFuh59GwpTuSju4STcflihmkzAfBgNVHSMEGDAWgBSfpxVdAF5iXYP05dJl +# pxtTNRnpcjBfBgNVHR8EWDBWMFSgUqBQhk5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIwMjAx +# MCgxKS5jcmwwbAYIKwYBBQUHAQEEYDBeMFwGCCsGAQUFBzAChlBodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY3Jvc29mdCUyMFRpbWUtU3Rh +# bXAlMjBQQ0ElMjAyMDEwKDEpLmNydDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoG +# CCsGAQUFBwMIMA0GCSqGSIb3DQEBCwUAA4ICAQA1r3Oz0lEq3VvpdFlh3YBxc4hn +# YkALyYPDa9FO4XgqwkBm8Lsb+lK3tbGGgpi6QJbK3iM3BK0ObBcwRaJVCxGLGtr6 +# Jz9hRumRyF8o4n2y3YiKv4olBxNjFShSGc9E29JmVjBmLgmfjRqPc/2rD25q4ow4 +# uA3rc9ekiaufgGhcSAdek/l+kASbzohOt/5z2+IlgT4e3auSUzt2GAKfKZB02ZDG +# WKKeCY3pELj1tuh6yfrOJPPInO4ZZLW3vgKavtL8e6FJZyJoDFMewJ59oEL+AK3e +# 2M2I4IFE9n6LVS8bS9UbMUMvrAlXN5ZM2I8GdHB9TbfI17Wm/9Uf4qu588PJN7vC +# Jj9s+KxZqXc5sGScLgqiPqIbbNTE+/AEZ/eTixc9YLgTyMqakZI59wGqjrONQSY7 +# u0VEDkEE6ikz+FSFRKKzpySb0WTgMvWxsLvbnN8ACmISPnBHYZoGssPAL7foGGKF +# LdABTQC2PX19WjrfyrshHdiqSlCspqIGBTxRaHtyPMro3B/26gPfCl3MC3rC3NGq +# 4xGnIHDZGSizUmGg8TkQAloVdU5dJ1v910gjxaxaUraGhP8IttE0RWnU5XRp/sGa +# NmDcMwbyHuSpaFsn3Q21OzitP4BnN5tprHangAC7joe4zmLnmRnAiUc9sRqQ2bms +# MAvUpsO8nlOFmiM1LzCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUw +# DQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhv +# cml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +# ggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg +# 4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aO +# RmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41 +# JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5 +# LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL +# 64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9 +# QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj +# 0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqE +# UUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0 +# kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435 +# UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB +# 3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTE +# mr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwG +# A1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93 +# d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNV +# HSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNV +# HQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo +# 0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29m +# dC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5j +# cmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDAN +# BgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4 +# sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th54 +# 2DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRX +# ud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBew +# VIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0 +# DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+Cljd +# QDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFr +# DZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFh +# bHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7n +# tdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+ +# oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6Fw +# ZvKhggLXMIICQAIBATCCAQChgdikgdUwgdIxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046QTI0MC00Qjgy +# LTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2WiIwoB +# ATAHBgUrDgMCGgMVAIBzlZM9TRND4PgtpLWQZkSPYVcJoIGDMIGApH4wfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwDQYJKoZIhvcNAQEFBQACBQDl73XWMCIY +# DzIwMjIwMzMxMDgzNTM0WhgPMjAyMjA0MDEwODM1MzRaMHcwPQYKKwYBBAGEWQoE +# ATEvMC0wCgIFAOXvddYCAQAwCgIBAAICF6kCAf8wBwIBAAICER8wCgIFAOXwx1YC +# AQAwNgYKKwYBBAGEWQoEAjEoMCYwDAYKKwYBBAGEWQoDAqAKMAgCAQACAwehIKEK +# MAgCAQACAwGGoDANBgkqhkiG9w0BAQUFAAOBgQAY60kde7HWABLbM75dgVqLPwu2 +# UX3qQDaoStTqkS7953pYHKc6GEqRd/nLCCeYBqC+XJRMTMNbd4ZDkkCzsxlr5HFi +# GE6eT7+KvwqQf+djK59ZAts0no9RPZcdCJwQfvqU3RK91gp/Sg2bCMvAfTN4LRGp +# qQ4tYYP2GrJJNqVbkDGCBA0wggQJAgEBMIGTMHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABjXpVLnh0mSq3AAEAAAGNMA0GCWCGSAFlAwQCAQUAoIIB +# SjAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwLwYJKoZIhvcNAQkEMSIEIOQz +# W64DlGXuO2zRgqB/n+gyoReL9ldfVdiKRVTSCDK+MIH6BgsqhkiG9w0BCRACLzGB +# 6jCB5zCB5DCBvQQgnpYRM/odXkDAnzf2udL569W8cfGTgwVuenQ8ttIYzX8wgZgw +# gYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD +# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAY16VS54dJkq +# twABAAABjTAiBCCgvCueU3dRfCsOKSpG5oksOx2/8SHFEjSLBygedl9oUzANBgkq +# hkiG9w0BAQsFAASCAgASDKu2OAv74hH075B2jN90FtXMtuST3zF61GC5OXm38b4j +# NSjLjbMslJJqeXiyODEQFNxmdE9AgPguQK13CeNnqsx2krlMfIC4o+M2pN7lqWCk +# gWfp5QemsmucuotA2dXLF98jGlQ1JShvFVOvUyxs0QKejf323B/mYdoUzvKurP1M +# k+FUjq/w3mgN9oj5oHoCIkdg1gDWNh80zEa0/YxEE7YYzg8bPLsGpK+f7B75Q51Y +# Sz7Gp/LGpQiG/LjytNQmsHwy/bl3FCr5/2WxBkAs8BneisPIfNLW0gfEo5Azkjo9 +# KEm5l8ILkJ3/4Qx9HiGjqwrdto8kGWAlGoIELtsO0BGT4onF4ynlKQgw82JK+4RD +# tWXCnPqjojkl+/4tfbeEdUoPvNgYpvS6ZRRYJIWg5s7XViroohZCCSkqt8aMjTZF +# HJBsKzmdHvVvAGELQ7TKaN3mOMUXb/o4vIK0TYrYN6FUn5iVnA7X2LIbJj0j3Mef +# BwEeOFhSjxz2Ob1oihNBoR1v5y+XfkbT7igIVQqwM27ujcOooOsDkpgizs0FajJV +# jeRsqEsXgfpaKCAq5czpOTutrvvwEn/cINrR3JW1TRSGt3VUvSWkmBs1T+7Oj6H6 +# ewWQaQIDYdEiDUL8OJhl+GzebujxPo//NXTY0MZCxK3DXhXi5okwsImzh5010w== +# SIG # End signature block diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll new file mode 100644 index 000000000000..67edb79248ca Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll new file mode 100644 index 000000000000..0d214db71cad Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll new file mode 100644 index 000000000000..2b2e59f4a657 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 000000000000..869ac1b86c57 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..d22ddefa2339 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..7f392562319f Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll new file mode 100644 index 000000000000..6344999edbb3 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll new file mode 100644 index 000000000000..9b0ae142146e Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll new file mode 100644 index 000000000000..c517a3b62cc7 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll new file mode 100644 index 000000000000..a2b54fb042de Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll new file mode 100644 index 000000000000..5aa381018c00 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll new file mode 100644 index 000000000000..bdfc501e9647 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll new file mode 100644 index 000000000000..8bd471e74c6e Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll new file mode 100644 index 000000000000..08659724d4f8 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll new file mode 100644 index 000000000000..3f9f84edf0ed Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll new file mode 100644 index 000000000000..64a57cbbecce Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 000000000000..0c27a0e21c7e Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll new file mode 100644 index 000000000000..e8074324cd13 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll new file mode 100644 index 000000000000..4f4c30e080bd Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll new file mode 100644 index 000000000000..d1af38f0f8b7 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll new file mode 100644 index 000000000000..afd187c14918 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll new file mode 100644 index 000000000000..c1aa0a64f8f9 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll new file mode 100644 index 000000000000..6d2b207854ac Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll new file mode 100644 index 000000000000..a3a85c2b7255 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll new file mode 100644 index 000000000000..dfab23478ab4 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll new file mode 100644 index 000000000000..022e63a21a86 Binary files /dev/null and b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll differ diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 new file mode 100644 index 000000000000..f234bd2dd7e5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 @@ -0,0 +1,278 @@ +function Write-InstallationCheckToFile +{ + Param($installationchecks) + if (Get-Module AzureRM.Profile -ListAvailable -ErrorAction Ignore) + { + Write-Warning ("Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide") + } + + $installationchecks.Add("AzSideBySideCheck","true") + try + { + if (Test-Path $pathToInstallationChecks -ErrorAction Ignore) + { + Remove-Item -Path $pathToInstallationChecks -ErrorAction Stop + } + + $pathToInstallDir = Split-Path -Path $pathToInstallationChecks -Parent -ErrorAction Stop + if (Test-Path $pathToInstallDir -ErrorAction Ignore) + { + New-Item -Path $pathToInstallationChecks -ErrorAction Stop -ItemType File -Value ($installationchecks | ConvertTo-Json -ErrorAction Stop) + } + } + catch + { + Write-Verbose "Installation checks failed to write to file." + } +} + +if (!($env:SkipAzInstallationChecks -eq "true")) +{ + $pathToInstallationChecks = Join-Path (Join-Path $HOME ".Azure") "AzInstallationChecks.json" + $installationchecks = @{} + if (!(Test-Path $pathToInstallationChecks -ErrorAction Ignore)) + { + Write-InstallationCheckToFile $installationchecks + } + else + { + try + { + ((Get-Content $pathToInstallationChecks -ErrorAction Stop) | ConvertFrom-Json -ErrorAction Stop).PSObject.Properties | Foreach { $installationchecks[$_.Name] = $_.Value } + } + catch + { + Write-InstallationCheckToFile $installationchecks + } + + if (!$installationchecks.ContainsKey("AzSideBySideCheck")) + { + Write-InstallationCheckToFile $installationchecks + } + } +} + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +Update-TypeData -AppendPath (Join-Path (Get-Item $PSScriptRoot).Parent.FullName Accounts.types.ps1xml) -ErrorAction Ignore +# SIG # Begin signature block +# MIInuQYJKoZIhvcNAQcCoIInqjCCJ6YCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDT3s8rOGw0kP8l +# AbYXJ7G9hr2fOKBRtW5xO6fWVEOZvqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjjCCGYoCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgpH7D8Not +# WnytrY9dBBVdkjoPJbp/Jb5/OaJtNH+9PHMwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQBeESsu04jkAEIOu00+XAL5Cw3b4lPK1+Y/A63nt7uC +# g0IvVE66lSl52+b6CVBX/G72fi7HlOIYoCyVKEIasUVN+dqAtdM2ib0RLRPrWxH9 +# 2axBlgxQg9nBAZkklffNIZjmkC+gZN37i3g0DHSwmb1ej9OwHDD0MYQpF8oIa81e +# oj07j6dAzRwVM0TaHEJj9kPXA81HN6CAYBJ/V3p0wYRbp3c2L9j2R9MtVVvnx/7z +# sbKvHJV+l3b/xCT5T0/J5l5QoLzzNyfWB7Zvaz0DbKX1bln/rcb8uPYKVEz4wsKW +# 5zAm12WLQ87vxiIGLA6tv4lXxggEAUm68Nwjfw6vqkHRoYIXGDCCFxQGCisGAQQB +# gjcDAwExghcEMIIXAAYJKoZIhvcNAQcCoIIW8TCCFu0CAQMxDzANBglghkgBZQME +# AgEFADCCAVgGCyqGSIb3DQEJEAEEoIIBRwSCAUMwggE/AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIEbwTnYvqLH2wAcLSr8ZwikKunQnLTH8PEiqd0Vr +# sTtWAgZiMTFcHxoYEjIwMjIwMzMxMTAwMDA4Ljg4WjAEgAIB9KCB2KSB1TCB0jEL +# MAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1v +# bmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWlj +# cm9zb2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFs +# ZXMgVFNTIEVTTjpBMjQwLTRCODItMTMwRTElMCMGA1UEAxMcTWljcm9zb2Z0IFRp +# bWUtU3RhbXAgU2VydmljZaCCEWgwggcUMIIE/KADAgECAhMzAAABjXpVLnh0mSq3 +# AAEAAAGNMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpX +# YXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQg +# Q29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAy +# MDEwMB4XDTIxMTAyODE5Mjc0NVoXDTIzMDEyNjE5Mjc0NVowgdIxCzAJBgNVBAYT +# AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYD +# VQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJ +# cmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBF +# U046QTI0MC00QjgyLTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFNlcnZpY2UwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDaNEgtmD47 +# pTt0ty7AE8wH7S0lTPTAcuonl/soldCxPNZOgANQxhXjFVmen2Y9NaiNQn+Xc7he +# p6AsM124UA5tyK2svJjkcOzEB9QbX/ZiKVxKRI/oJwypZ+xLBQsZfnOWxUocnu2/ +# CDbrLp4uSVR0UymKrb3hPi4lB1d3k7uYXLS9WRoY8bE1YttnEo3Ooq0WdZDuMy1n +# Tle9p+QhZms1MW/wYakCUe1GxnUDwoOjogNIZU1lldtCz587Aw4an8HOh3x/Vgjw +# Zvag3+bHZxy90av2VrnlBl5Wwzst9NoQ9DFuABwuBYOUg9yZPNwGSwTMs5CxKkHO +# yo9pYj3KRXDmh+auQUoxulBPkQySLay4mhUznEaB1lae3+3PTTG5s9IoWLgHggwV +# QH2ZwA1Sr1wdouwdsMn4BSxU7SqdWPDNc9gl5HsL8HxfRSXpSQh2mVmadxBlIErf +# JlDL6gay4kpcUCrcGXFPqQO6Fhi87uK0us95jSSe63WsqTGib66Lq8J22EJ+cCLK +# SfJELaWSerPPzHWYORDlDo7H2nr+V24W6lIky2CwI8318i+t+mkwMUi9GhQuwc50 +# smOtGWLxyjkz69mZ/bShPFi5fMzS1tG6sQnJwHlkxvDOewUfKY6SDLHw54WddXdx +# qvjm56MjUHWKpQNt5I3Ge9zO46FynPBpyQIDAQABo4IBNjCCATIwHQYDVR0OBBYE +# FHjMkW6Hn0bClO5KO7hJNx+WKGaTMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWn +# G1M1GelyMF8GA1UdHwRYMFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNv +# bS9wa2lvcHMvY3JsL01pY3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEw +# KDEpLmNybDBsBggrBgEFBQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFt +# cCUyMFBDQSUyMDIwMTAoMSkuY3J0MAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYI +# KwYBBQUHAwgwDQYJKoZIhvcNAQELBQADggIBADWvc7PSUSrdW+l0WWHdgHFziGdi +# QAvJg8Nr0U7heCrCQGbwuxv6Ure1sYaCmLpAlsreIzcErQ5sFzBFolULEYsa2von +# P2FG6ZHIXyjifbLdiIq/iiUHE2MVKFIZz0Tb0mZWMGYuCZ+NGo9z/asPbmrijDi4 +# Detz16SJq5+AaFxIB16T+X6QBJvOiE63/nPb4iWBPh7dq5JTO3YYAp8pkHTZkMZY +# op4JjekQuPW26HrJ+s4k88ic7hlktbe+Apq+0vx7oUlnImgMUx7Ann2gQv4Ard7Y +# zYjggUT2fotVLxtL1RsxQy+sCVc3lkzYjwZ0cH1Nt8jXtab/1R/iq7nzw8k3u8Im +# P2z4rFmpdzmwZJwuCqI+ohts1MT78ARn95OLFz1guBPIypqRkjn3AaqOs41BJju7 +# RUQOQQTqKTP4VIVEorOnJJvRZOAy9bGwu9uc3wAKYhI+cEdhmgayw8Avt+gYYoUt +# 0AFNALY9fX1aOt/KuyEd2KpKUKymogYFPFFoe3I8yujcH/bqA98KXcwLesLc0arj +# EacgcNkZKLNSYaDxORACWhV1Tl0nW/3XSCPFrFpStoaE/wi20TRFadTldGn+wZo2 +# YNwzBvIe5KloWyfdDbU7OK0/gGc3m2msdqeAALuOh7jOYueZGcCJRz2xGpDZuaww +# C9Smw7yeU4WaIzUvMIIHcTCCBVmgAwIBAgITMwAAABXF52ueAptJmQAAAAAAFTAN +# BgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9y +# aXR5IDIwMTAwHhcNMjEwOTMwMTgyMjI1WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYD +# VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEe +# MBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3Nv +# ZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCC +# AgoCggIBAOThpkzntHIhC3miy9ckeb0O1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDi +# vbk+F2Az/1xPx2b3lVNxWuJ+Slr+uDZnhUYjDLWNE893MsAQGOhgfWpSg0S3po5G +# awcU88V29YZQ3MFEyHFcUTE3oAo4bo3t1w/YJlN8OWECesSq/XJprx2rrPY2vjUm +# ZNqYO7oaezOtgFt+jBAcnVL+tuhiJdxqD89d9P6OU8/W7IVWTe/dvI2k45GPsjks +# UZzpcGkNyjYtcI4xyDUoveO0hyTD4MmPfrVUj9z6BVWYbWg7mka97aSueik3rMvr +# g0XnRm7KMtXAhjBcTyziYrLNueKNiOSWrAFKu75xqRdbZ2De+JKRHh09/SDPc31B +# mkZ1zcRfNN0Sidb9pSB9fvzZnkXftnIv231fgLrbqn427DZM9ituqBJR6L8FA6PR +# c6ZNN3SUHDSCD/AQ8rdHGO2n6Jl8P0zbr17C89XYcz1DTsEzOUyOArxCaC4Q6oRR +# RuLRvWoYWmEBc8pnol7XKHYC4jMYctenIPDC+hIK12NvDMk2ZItboKaDIV1fMHSR +# lJTYuVD5C4lh8zYGNRiER9vcG9H9stQcxWv2XFJRXRLbJbqvUAV6bMURHXLvjflS +# xIUXk8A8FdsaN8cIFRg/eKtFtvUeh17aj54WcmnGrnu3tz5q4i6tAgMBAAGjggHd +# MIIB2TASBgkrBgEEAYI3FQEEBQIDAQABMCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSa +# voKRPEY1Kc8Q/y8E7jAdBgNVHQ4EFgQUn6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYD +# VR0gBFUwUzBRBgwrBgEEAYI3TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMBMGA1Ud +# JQQMMAoGCCsGAQUFBwMIMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjR +# PZSQW9fOmhjEMFYGA1UdHwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNy +# bDBaBggrBgEFBQcBAQROMEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93d3cubWljcm9z +# b2Z0LmNvbS9wa2kvY2VydHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0G +# CSqGSIb3DQEBCwUAA4ICAQCdVX38Kq3hLB9nATEkW+Geckv8qW/qXBS2Pk5HZHix +# BpOXPTEztTnXwnE2P9pkbHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjY +# Ni6cqYJWAAOwBb6J6Gngugnue99qb74py27YP0h1AdkY3m2CDPVtI1TkeFN1JFe5 +# 3Z/zjj3G82jfZfakVqr3lbYoVSfQJL1AoL8ZthISEV09J+BAljis9/kpicO8F7BU +# hUKz/AyeixmJ5/ALaoHCgRlCGVJ1ijbCHcNhcy4sa3tuPywJeBTpkbKpW99Jo3QM +# vOyRgNI95ko+ZjtPu4b6MhrZlvSP9pEB9s7GdP32THJvEKt1MMU0sHrYUP4KWN1A +# PMdUbZ1jdEgssU5HLcEUBHG/ZPkkvnNtyo4JvbMBV0lUZNlz138eW0QBjloZkWsN +# n6Qo3GcZKCS6OEuabvshVGtqRRFHqfG3rsjoiV5PndLQTHa1V1QJsWkBRH58oWFs +# c/4Ku+xBZj1p/cvBQUl+fpO+y/g75LcVv7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue1 +# 0CgaiQuPNtq6TPmb/wrpNPgkNWcr4A245oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6g +# MTN9vMvpe784cETRkPHIqzqKOghif9lwY1NNje6CbaUFEMFxBmoQtB1VM1izoXBm +# 8qGCAtcwggJAAgEBMIIBAKGB2KSB1TCB0jELMAkGA1UEBhMCVVMxEzARBgNVBAgT +# Cldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29m +# dCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9zb2Z0IElyZWxhbmQgT3BlcmF0 +# aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjpBMjQwLTRCODIt +# MTMwRTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZaIjCgEB +# MAcGBSsOAwIaAxUAgHOVkz1NE0Pg+C2ktZBmRI9hVwmggYMwgYCkfjB8MQswCQYD +# VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEe +# MBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3Nv +# ZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIFAOXvddYwIhgP +# MjAyMjAzMzEwODM1MzRaGA8yMDIyMDQwMTA4MzUzNFowdzA9BgorBgEEAYRZCgQB +# MS8wLTAKAgUA5e911gIBADAKAgEAAgIXqQIB/zAHAgEAAgIRHzAKAgUA5fDHVgIB +# ADA2BgorBgEEAYRZCgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIBAAIDB6EgoQow +# CAIBAAIDAYagMA0GCSqGSIb3DQEBBQUAA4GBABjrSR17sdYAEtszvl2BWos/C7ZR +# fepANqhK1OqRLv3nelgcpzoYSpF3+csIJ5gGoL5clExMw1t3hkOSQLOzGWvkcWIY +# Tp5Pv4q/CpB/52Mrn1kC2zSej1E9lx0InBB++pTdEr3WCn9KDZsIy8B9M3gtEamp +# Di1hg/Yaskk2pVuQMYIEDTCCBAkCAQEwgZMwfDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAg +# UENBIDIwMTACEzMAAAGNelUueHSZKrcAAQAAAY0wDQYJYIZIAWUDBAIBBQCgggFK +# MBoGCSqGSIb3DQEJAzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0BCQQxIgQgv72G +# 0X2zWUJuJvjSqtgMZ02BVYmEgLTkIUsRp8UHvXIwgfoGCyqGSIb3DQEJEAIvMYHq +# MIHnMIHkMIG9BCCelhEz+h1eQMCfN/a50vnr1bxx8ZODBW56dDy20hjNfzCBmDCB +# gKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQH +# EwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNV +# BAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAABjXpVLnh0mSq3 +# AAEAAAGNMCIEIKC8K55Td1F8Kw4pKkbmiSw7Hb/xIcUSNIsHKB52X2hTMA0GCSqG +# SIb3DQEBCwUABIICAMsOXK3vJQX7Jt2lDwVppNTdiboPDVwXRfezsK8NLGK7wZhp +# e/fEsGp3kFdqmeiDT/QGZV+ixnGjOTyJSaq6+wtvZyqKLUoEkhD9g+hFk23Hn3ui +# RiAp6LSf263zzgNQ9SbNssjiOChkILaTpt+GeV+lHAH6N412gYM7pbVyw9v7jvx+ +# Mp+iFKUVQAqZZDGm55MyTqfVdPeb8YpN9pqPSYG4ruCTwZBYGI+p7LFuKgQqF+FB +# 2KTqsTuxoHI6HAV3OibJcIFKQLFxaHjD0/YjYeZSoMUMD/ojZpdEoFrLtTXmIZ2e +# yOFKcX1LMzwwHhEpOpc9m9g4/B2kYTHUl1hFupXEu9PZnNa0IweqtM/GdX/Ji/// +# JRcDe8vtLNQz7z8ZQF28k1ufRDGfm5YIQDHu9Zx33gbpsWIyGZMmlbU4UMJDvAbM +# +sCYtGGLcMEObyiurnDOF4dix7QAdLWqGG2YiyZ9u0T/hRLi3THXhLGK5Xt4dgBk +# aeyJv7T3ZPfsbu8a10lgFkyVbmJt6up2OZbaqW1PjmvgtcsNmRyhD9oSZzOXdTiW +# iIGeLtHEkiSvZnWbaDqpx7ahcaHsmS5QvwWkYGGx1uHMOwJHuFq7jKPo3SYMxAwq +# GQW+QTZroDYL+UTfaUobfPyrS3bDw3L7xVqOOBwGidlOwx3ZYU4mNlSbfCN3 +# SIG # End signature block diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 new file mode 100644 index 000000000000..4e557723dc33 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 @@ -0,0 +1,234 @@ +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } + catch { + Write-Warning $_ + } +} +else { + try { + Add-Type -Path ([System.IO.Path]::Combine($PSScriptRoot, "..", "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll")) | Out-Null + $assemblyLoadContextFolder = [System.IO.Path]::Combine($PSScriptRoot, "..", "AzSharedAlcAssemblies") + Write-Debug "Registering Az shared AssemblyLoadContext for path: '$assemblyLoadContextFolder'." + [Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.AzAssemblyLoadContextInitializer]::RegisterAzSharedAssemblyLoadContext($assemblyLoadContextFolder) + Write-Debug "AssemblyLoadContext registered." + } + catch { + Write-Warning $_ + } +} +# SIG # Begin signature block +# MIInrQYJKoZIhvcNAQcCoIInnjCCJ5oCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCfno9x0LEd5gPe +# 4cvAg6ULJtMLR6g+Xis+I4rbSZlHZqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZgjCCGX4CAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgyFkgUqEG +# ohT1KbDw544Hgmj3zWoOXkAlMHIwAyFcowAwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCa0t0uHrS1Z8rXJEETxc2oe78Dv4Qo198ub5+3zLvP +# Uwb+RkVmouToXjo3dapicrrP8ELcphopBonxGcVJFdu9HT8uuwL9KEp0yDpjUxKA +# 0yPVc1pc+f5vmlLY1kyUHMb9Deahzp5oJnL6NLyupJ8w6DLb21SCiIWl71l5vf2B +# i8Nx+jIjxGEC5Emqk6GLFAjR4TR6KO1j6gkHutOu3k0Q/+CgvgEwPbwtBXjcE9jV +# u7AZ6Iu5mE8q7NQ01GwWUMs13xpWLxE8HgvWtu3ozXjFeFaG3u9NEyx/zlkEB1cS +# Ntqh/F34ovkTvJxnIBPSRZfGubCV0fp9Qm0gXxrz3y/roYIXDDCCFwgGCisGAQQB +# gjcDAwExghb4MIIW9AYJKoZIhvcNAQcCoIIW5TCCFuECAQMxDzANBglghkgBZQME +# AgEFADCCAVUGCyqGSIb3DQEJEAEEoIIBRASCAUAwggE8AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIBvIyrpwHucEdb9YUkDCNmUPQk1ErTyZteMy3AB+ +# P++VAgZiL7Y+PNcYEzIwMjIwMzMxMTAwMDA5LjE3NlowBIACAfSggdSkgdEwgc4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKTAnBgNVBAsTIE1p +# Y3Jvc29mdCBPcGVyYXRpb25zIFB1ZXJ0byBSaWNvMSYwJAYDVQQLEx1UaGFsZXMg +# VFNTIEVTTjo2MEJDLUUzODMtMjYzNTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUt +# U3RhbXAgU2VydmljZaCCEV8wggcQMIIE+KADAgECAhMzAAABpllFgzlNnutLAAEA +# AAGmMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNo +# aW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29y +# cG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEw +# MB4XDTIyMDMwMjE4NTEyMVoXDTIzMDUxMTE4NTEyMVowgc4xCzAJBgNVBAYTAlVT +# MRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQK +# ExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVy +# YXRpb25zIFB1ZXJ0byBSaWNvMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjo2MEJD +# LUUzODMtMjYzNTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2Vydmlj +# ZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANmYv3tSI+fJ/NQJnjz7 +# JvCnc+Xm0rKoe9YKD4MvMYCul7egdrT/zv5vFbQgjNQ74672fNweaztkR65V8y29 +# u5PL2sf01p+uche0Zu4tSig+GsQ6ZQl9tjPRAY/3ITBHDeIYyvq8Wne9+7NoPLhx +# DSO6dtX7YCuQ4zcTP3SE6MvB4b5NighdtvoZVaYk1lXpjUTfdmKoX1ABq1sJbULS +# nSi0Qd4vvl3mZ9jxwv9dR/nlZP62lrZYZq7LPtHD6BlmclB5PT89DnSm1sjaZnFH +# rKzOsmq5GlmL5SFugCCZOoKz133FJeQaFMcXBZSCQjNABWBbHIRCE1ysHHG83Ddo +# nRmnC8EOlYeRwTWz/QCz6q0riOIbYyC/A2BgUEpu9/9EymrTsyMr2/zS8GdEybQ5 +# W7f0WrcrmKB/Y62+g6TmfOS8NtU+L1jGoKNG6Q5RlfJwZu8J/Q9dl4OxyHKuy78+ +# wm6HsF7uAizpsWh63UUaoK/OGQiBG3NJ+kef5eWpnva4ZJfhAnqYTAZD1uHgf8Vf +# Qjnl0BB2YXzK9WaTqde8d+8qCxVKr5hJYvbO+X3+2k5PCirUK/SboreX+xUhVaQE +# hVDYqlatyPttI7Z2IrkhMzwFvc+p0QeyMiNmo2cBZejx8icDOcUidwymDUYqGPE7 +# MA8vtKW3feeSSYJsCEkuUO/vAgMBAAGjggE2MIIBMjAdBgNVHQ4EFgQUOlQhO/zG +# lqK99UkNL/Gu/AryN9gwHwYDVR0jBBgwFoAUn6cVXQBeYl2D9OXSZacbUzUZ6XIw +# XwYDVR0fBFgwVjBUoFKgUIZOaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9w +# cy9jcmwvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAoMSkuY3Js +# MGwGCCsGAQUFBwEBBGAwXjBcBggrBgEFBQcwAoZQaHR0cDovL3d3dy5taWNyb3Nv +# ZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENB +# JTIwMjAxMCgxKS5jcnQwDAYDVR0TAQH/BAIwADATBgNVHSUEDDAKBggrBgEFBQcD +# CDANBgkqhkiG9w0BAQsFAAOCAgEAgMDxWDTpGqLnFoPhm/iDfwHGF8xr2NbrJl8e +# gEg2ThTJsTf0wBE+ZQsnYfrRmXBbe6sCXLVN70qPuI+OEbN5MOai7Bue1/4j5VTk +# WquH5GZeVat2N+dD7lSUWp0dU8j+uBhBL5GFSmoDVVm+zW2GR2juPI1v254AJTb2 +# l458anlkJjGvmYn2BtRS13h/wDR7hrQaI7BgdyHWAV5+HEj5UhrIrrvtwJiivSaU +# EA3qK6ZK/rZIQv/uORDkONw+2pHHIE1SXm/WIlhrVS2HIogfr3JjqvZion6LJSD7 +# 41j8xVDLiClwAbspHoVFjxtxBcMjqPx6aWCJS8vjSoTnhkV4PO55mqsM7Q8XQRGQ +# hA7w4zNQOJu9kD4xFdYpPUmLN/daIcEElofBjGz+sEd1B4yqqIk3u2G4VygTXFmt +# hL8chSo7r+GIvTqWKhSA/sanS4N3jCgCCe3FTSJsp4g5nwavLvWAtzcOIvSRorGm +# AeN0m2wgzBK95T/qgrGGDXSos1JNDWRVBnP0qsw1Qoq5G0D8hxvQPs3X43KBv1GJ +# l0wo5rcC+9OMWxJlB63gtToQsA1CErYoYLMZtUzJL74jwZk/grpHEQhIhB3sneC8 +# wzGKJuft7YO/HWCpuwdChIjynTnBh+yFGMdg3wRrIbOcw/iKmXZopMTQMOcmIeIw +# JAezA7AwggdxMIIFWaADAgECAhMzAAAAFcXna54Cm0mZAAAAAAAVMA0GCSqGSIb3 +# DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G +# A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTIw +# MAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgMjAx +# MDAeFw0yMTA5MzAxODIyMjVaFw0zMDA5MzAxODMyMjVaMHwxCzAJBgNVBAYTAlVT +# MRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQK +# ExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1l +# LVN0YW1wIFBDQSAyMDEwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA +# 5OGmTOe0ciELeaLL1yR5vQ7VgtP97pwHB9KpbE51yMo1V/YBf2xK4OK9uT4XYDP/ +# XE/HZveVU3Fa4n5KWv64NmeFRiMMtY0Tz3cywBAY6GB9alKDRLemjkZrBxTzxXb1 +# hlDcwUTIcVxRMTegCjhuje3XD9gmU3w5YQJ6xKr9cmmvHaus9ja+NSZk2pg7uhp7 +# M62AW36MEBydUv626GIl3GoPz130/o5Tz9bshVZN7928jaTjkY+yOSxRnOlwaQ3K +# Ni1wjjHINSi947SHJMPgyY9+tVSP3PoFVZhtaDuaRr3tpK56KTesy+uDRedGbsoy +# 1cCGMFxPLOJiss254o2I5JasAUq7vnGpF1tnYN74kpEeHT39IM9zfUGaRnXNxF80 +# 3RKJ1v2lIH1+/NmeRd+2ci/bfV+AutuqfjbsNkz2K26oElHovwUDo9Fzpk03dJQc +# NIIP8BDyt0cY7afomXw/TNuvXsLz1dhzPUNOwTM5TI4CvEJoLhDqhFFG4tG9ahha +# YQFzymeiXtcodgLiMxhy16cg8ML6EgrXY28MyTZki1ugpoMhXV8wdJGUlNi5UPkL +# iWHzNgY1GIRH29wb0f2y1BzFa/ZcUlFdEtsluq9QBXpsxREdcu+N+VLEhReTwDwV +# 2xo3xwgVGD94q0W29R6HXtqPnhZyacaue7e3PmriLq0CAwEAAaOCAd0wggHZMBIG +# CSsGAQQBgjcVAQQFAgMBAAEwIwYJKwYBBAGCNxUCBBYEFCqnUv5kxJq+gpE8RjUp +# zxD/LwTuMB0GA1UdDgQWBBSfpxVdAF5iXYP05dJlpxtTNRnpcjBcBgNVHSAEVTBT +# MFEGDCsGAQQBgjdMg30BATBBMD8GCCsGAQUFBwIBFjNodHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpb3BzL0RvY3MvUmVwb3NpdG9yeS5odG0wEwYDVR0lBAwwCgYI +# KwYBBQUHAwgwGQYJKwYBBAGCNxQCBAweCgBTAHUAYgBDAEEwCwYDVR0PBAQDAgGG +# MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAU1fZWy4/oolxiaNE9lJBb186a +# GMQwVgYDVR0fBE8wTTBLoEmgR4ZFaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3Br +# aS9jcmwvcHJvZHVjdHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3JsMFoGCCsG +# AQUFBwEBBE4wTDBKBggrBgEFBQcwAoY+aHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraS9jZXJ0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5jcnQwDQYJKoZIhvcN +# AQELBQADggIBAJ1VffwqreEsH2cBMSRb4Z5yS/ypb+pcFLY+TkdkeLEGk5c9MTO1 +# OdfCcTY/2mRsfNB1OW27DzHkwo/7bNGhlBgi7ulmZzpTTd2YurYeeNg2LpypglYA +# A7AFvonoaeC6Ce5732pvvinLbtg/SHUB2RjebYIM9W0jVOR4U3UkV7ndn/OOPcbz +# aN9l9qRWqveVtihVJ9AkvUCgvxm2EhIRXT0n4ECWOKz3+SmJw7wXsFSFQrP8DJ6L +# GYnn8AtqgcKBGUIZUnWKNsIdw2FzLixre24/LAl4FOmRsqlb30mjdAy87JGA0j3m +# Sj5mO0+7hvoyGtmW9I/2kQH2zsZ0/fZMcm8Qq3UwxTSwethQ/gpY3UA8x1RtnWN0 +# SCyxTkctwRQEcb9k+SS+c23Kjgm9swFXSVRk2XPXfx5bRAGOWhmRaw2fpCjcZxko +# JLo4S5pu+yFUa2pFEUep8beuyOiJXk+d0tBMdrVXVAmxaQFEfnyhYWxz/gq77EFm +# PWn9y8FBSX5+k77L+DvktxW/tM4+pTFRhLy/AsGConsXHRWJjXD+57XQKBqJC482 +# 2rpM+Zv/Cuk0+CQ1ZyvgDbjmjJnW4SLq8CdCPSWU5nR0W2rRnj7tfqAxM328y+l7 +# vzhwRNGQ8cirOoo6CGJ/2XBjU02N7oJtpQUQwXEGahC0HVUzWLOhcGbyoYIC0jCC +# AjsCAQEwgfyhgdSkgdEwgc4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1ZXJ0byBSaWNv +# MSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjo2MEJDLUUzODMtMjYzNTElMCMGA1UE +# AxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUA +# anQzrZW9TB93Ve7Pa4UPao2ffK2ggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEG +# A1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWlj +# cm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFt +# cCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIFAOXv9TcwIhgPMjAyMjAzMzExMzM5 +# MDNaGA8yMDIyMDQwMTEzMzkwM1owdzA9BgorBgEEAYRZCgQBMS8wLTAKAgUA5e/1 +# NwIBADAKAgEAAgIlMAIB/zAHAgEAAgIRCDAKAgUA5fFGtwIBADA2BgorBgEEAYRZ +# CgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0G +# CSqGSIb3DQEBBQUAA4GBALD1RzDUwq+H9m0MSYjCz5wQ1OtK2kysUfWmpMU4m/5I +# had8kbNZdJ3KIrx0YGBUzNZ+Lq0oh2bND8oZcOvd2Hp24j+V7qoE3si8uVWGudxS +# modF1/mMXXk9ekKyQlZEjz3BMuu37KSyigsrBtFsCP8HOYXKBGcDbc6qn5XH4yKD +# MYIEDTCCBAkCAQEwgZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMA +# AAGmWUWDOU2e60sAAQAAAaYwDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJ +# AzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0BCQQxIgQgBSF4kR8GItz8rwRGC1l8 +# k8ybbSy8clYGHzCOxkaX3MUwgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCCD +# CxmLwz90fWvhMKbJTAQaKt3DoXeiAhfp8TD9tgSrDTCBmDCBgKR+MHwxCzAJBgNV +# BAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4w +# HAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29m +# dCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAABpllFgzlNnutLAAEAAAGmMCIEIBah +# XRJ2u8MV3DcxWnj3RsKu1063lhZi+mCg8CTJsOXVMA0GCSqGSIb3DQEBCwUABIIC +# AKwjzxsDe/9a9+S3w9P62SVFf6qdfGVu9TFSVozXaesncRAk2r5PYVIzQBLXEctH +# uMjKgizzU+OOxm1sxXQFxUa56d7W+W0Jg7ULtoKBKPQtEUN5uAo4j2bxZGMLqPMd +# DR5oFeKvtuIUk4DiXx02gUT6GITVUnFkkHt4y9j9PwZb7TNlan8/wTeTHO0kH2QZ +# xSt9oLx0jSb5/nBUCAE7G38h6P29oMvljU4xleVaSon0n73QlTg/hMAedxBVDol7 +# ZFh6Q93jDq/8l4XsA4y1UIObDo/8NxDvISc2tYeybT++wrtwkOLw6jpWXezk4uA3 +# cPi5rfOQhiBPG8dLCT9SWelaQWFq6wDL/wWQWWohrMVGaRoIp+p7TrRTUl3eoGIW +# lvUbTuUotQzzmQY1Zf8S4g430lulVYqdenhq6E3mzdU9VjueouAji4yYyJ8jeZmz +# c2e2W3goWOO5UWBujRETmFekpuj1cPiQ1en4QlRDeDHIgUa8OQcFbhof3cXZ0+CM +# mFYy5NofggR5oWN1IO6TAGc5w4tn+6i5RrR+C464W7R39A8peRCPXpZHMX5Nfinl +# McxNzvCRdwxdwMcfAl5fbvKiHAMFVaJlU8YkDHxtshVTBTAdB5scvBwEfVBqTRgN +# Y3evpxNmLhQ49mbUo+IsGdgKb4wU3AOkvXBDIVg0/Ll+ +# SIG # End signature block diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml new file mode 100644 index 000000000000..95d6227f2ef8 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/_rels/.rels b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/_rels/.rels new file mode 100644 index 000000000000..95479a0e6d24 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/_rels/.rels @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt new file mode 100644 index 000000000000..7e294d272854 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt @@ -0,0 +1,50 @@ +About topic for Azure PowerShell - about_az + +TOPIC + +about_Az + +SHORT DESCRIPTION + +The Azure Az PowerShell module is a set of cmdlets for managing Azure +resources directly from the PowerShell command line and in PowerShell +scripts. + +LONG DESCRIPTION + +Azure PowerShell provides cross-platform cmdlets for managing Azure +services. All Azure PowerShell cmdlets work on Windows PowerShell 5.1 and +supported versions of PowerShell 7. + +The Azure PowerShell cmdlets follow the naming convention {verb}-Az{noun}. + +- {verb} is an approved PowerShell verb reflecting the corresponding HTTP + operation. + +- {noun} matches or has a close equivalent to the name of the resource. + +The cmdlets produce .NET objects that can be piped between commands +simplifying the sequencing of commands making Azure PowerShell a powerful +solution for scripting and automation purposes. + +A PowerShell module is available for each Azure service. For convenience, +we provide a wrapper module named "Az" that comprises the stable modules. +Modules in preview must be installed independently or via the "AzPreview" +wrapper module. + +Azure PowerShell is frequently updated to include bug fixes and service +updates. It is recommended to plan to update to the most recent version +regularly (a minimum of twice a year). + +GETTING STARTED + +1. Connect to Azure using Connect-AzAccount + +2. Run your first command. For example, create a resource group in the + east US region. + + New-AzResourceGroup -Name "MyResoureGroup" -location "eastus" + +SEE ALSO + +Azure PowerShell documentation: https://docs.microsoft.com/powershell/azure diff --git a/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp new file mode 100644 index 000000000000..5c37526de859 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp @@ -0,0 +1,11 @@ + + + Microsoft Corporation + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps + Az.Accounts + 2.7.5 + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest + NuGet, Version=3.4.4.1321, Culture=neutral, PublicKeyToken=31bf3856ad364e35;Microsoft Windows NT 6.2.9200.0;.NET Framework 4.5 + \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/AsyncCommandRuntime.cs b/swaggerci/storSimple1200Series/generated/runtime/AsyncCommandRuntime.cs new file mode 100644 index 000000000000..a1c570ff3afb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/AsyncCommandRuntime.cs @@ -0,0 +1,832 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + using System.Linq; + + internal interface IAsyncCommandRuntimeExtensions + { + Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep func); + System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs); + + T ExecuteSync(System.Func step); + } + + public class AsyncCommandRuntime : System.Management.Automation.ICommandRuntime2, IAsyncCommandRuntimeExtensions, System.IDisposable + { + private ICommandRuntime2 originalCommandRuntime; + private System.Threading.Thread originalThread; + public bool AllowInteractive { get; set; } = false; + + public CancellationToken cancellationToken; + SemaphoreSlim semaphore = new SemaphoreSlim(1, 1); + ManualResetEventSlim readyToRun = new ManualResetEventSlim(false); + ManualResetEventSlim completed = new ManualResetEventSlim(false); + + System.Action runOnMainThread; + + private System.Management.Automation.PSCmdlet cmdlet; + + internal AsyncCommandRuntime(System.Management.Automation.PSCmdlet cmdlet, CancellationToken cancellationToken) + { + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + this.cancellationToken = cancellationToken; + this.cmdlet = cmdlet; + if (cmdlet.PagingParameters != null) + { + WriteDebug("Client side pagination is enabled for this cmdlet"); + } + cmdlet.CommandRuntime = this; + } + + public PSHost Host => this.originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => this.originalCommandRuntime.CurrentPSTransaction; + + private void CheckForInteractive() + { + // This is an interactive call -- if we are not on the original thread, this will only work if this was done at ACR creation time; + if (!AllowInteractive) + { + throw new System.Exception("AsyncCommandRuntime is not configured for interactive calls"); + } + } + private void WaitOurTurn() + { + // wait for our turn to play + semaphore?.Wait(cancellationToken); + + // ensure that completed is not set + completed.Reset(); + } + + private void WaitForCompletion() + { + // wait for the result (or cancellation!) + WaitHandle.WaitAny(new[] { cancellationToken.WaitHandle, completed?.WaitHandle }); + + // let go of the semaphore + semaphore?.Release(); + + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target, string action) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target, action); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target, action); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out shouldProcessReason); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + ShouldProcessReason reason = ShouldProcessReason.None; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out reason); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + shouldProcessReason = reason; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.ThrowTerminatingError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.ThrowTerminatingError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool TransactionAvailable() + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.TransactionAvailable(); + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.TransactionAvailable(); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteCommandDetail(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteCommandDetail(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteCommandDetail(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteDebug(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteDebug(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteDebug(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteInformation(informationRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteInformation(informationRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(sourceId, progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(sourceId, progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteVerbose(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteVerbose(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteVerbose(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteWarning(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteWarning(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteWarning(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Wait(System.Threading.Tasks.Task ProcessRecordAsyncTask, System.Threading.CancellationToken cancellationToken) + { + do + { + WaitHandle.WaitAny(new[] { readyToRun.WaitHandle, ((System.IAsyncResult)ProcessRecordAsyncTask).AsyncWaitHandle }); + if (readyToRun.IsSet) + { + // reset the request for the next time + readyToRun.Reset(); + + // run the delegate on this thread + runOnMainThread(); + + // tell the originator everything is complete + completed.Set(); + } + } + while (!ProcessRecordAsyncTask.IsCompleted); + if (ProcessRecordAsyncTask.IsFaulted) + { + // don't unwrap a Aggregate Exception -- we'll lose the stack trace of the actual exception. + // if( ProcessRecordAsyncTask.Exception is System.AggregateException aggregate ) { + // throw aggregate.InnerException; + // } + throw ProcessRecordAsyncTask.Exception; + } + } + public Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep func) => func.Target.GetType().Name != "Closure" ? func : (p1, p2, p3) => ExecuteSync>(() => func(p1, p2, p3)); + public System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs) => funcs?.Select(Wrap); + + public T ExecuteSync(System.Func step) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return step(); + } + + T result = default(T); + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + // set the function to run + runOnMainThread = () => { result = step(); }; + // tell the main thread to go ahead + readyToRun.Set(); + // wait for the result (or cancellation!) + WaitForCompletion(); + // return + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Dispose() + { + if (cmdlet != null) + { + cmdlet.CommandRuntime = this.originalCommandRuntime; + cmdlet = null; + } + + semaphore?.Dispose(); + semaphore = null; + readyToRun?.Dispose(); + readyToRun = null; + completed?.Dispose(); + completed = null; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/AsyncJob.cs b/swaggerci/storSimple1200Series/generated/runtime/AsyncJob.cs new file mode 100644 index 000000000000..24ce2838a484 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/AsyncJob.cs @@ -0,0 +1,270 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + + using System.Threading.Tasks; + + public class LongRunningJobCancelledException : System.Exception + { + public LongRunningJobCancelledException(string message) : base(message) + { + + } + } + + public class AsyncJob : Job, System.Management.Automation.ICommandRuntime2 + { + const int MaxRecords = 1000; + + private string _statusMessage = string.Empty; + + public override string StatusMessage => _statusMessage; + + public override bool HasMoreData => Output.Count > 0 || Progress.Count > 0 || Error.Count > 0 || Warning.Count > 0 || Verbose.Count > 0 || Debug.Count > 0; + + public override string Location => "localhost"; + + public PSHost Host => originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => originalCommandRuntime.CurrentPSTransaction; + + public override void StopJob() + { + Cancel(); + } + + private readonly PSCmdlet cmdlet; + private readonly ICommandRuntime2 originalCommandRuntime; + private readonly System.Threading.Thread originalThread; + + private void CheckForInteractive() + { + // This is an interactive call -- We should never allow interactivity in AsnycJob cmdlets. + throw new System.Exception("Cmdlets in AsyncJob; interactive calls are not permitted."); + } + private bool IsJobDone => CancellationToken.IsCancellationRequested || this.JobStateInfo.State == JobState.Failed || this.JobStateInfo.State == JobState.Stopped || this.JobStateInfo.State == JobState.Stopping || this.JobStateInfo.State == JobState.Completed; + + private readonly System.Action Cancel; + private readonly CancellationToken CancellationToken; + + internal AsyncJob(PSCmdlet cmdlet, string line, string name, CancellationToken cancellationToken, System.Action cancelMethod) : base(line, name) + { + SetJobState(JobState.NotStarted); + // know how to cancel/check for cancelation + this.CancellationToken = cancellationToken; + this.Cancel = cancelMethod; + + // we might need these. + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + + // the instance of the cmdlet we're going to run + this.cmdlet = cmdlet; + + // set the command runtime to the AsyncJob + cmdlet.CommandRuntime = this; + } + + /// + /// Monitors the task (which should be ProcessRecordAsync) to control + /// the lifetime of the job itself + /// + /// + public void Monitor(Task task) + { + SetJobState(JobState.Running); + task.ContinueWith(antecedent => + { + if (antecedent.IsCanceled) + { + // if the task was canceled, we're just going to call it completed. + SetJobState(JobState.Completed); + } + else if (antecedent.IsFaulted) + { + foreach (var innerException in antecedent.Exception.Flatten().InnerExceptions) + { + WriteError(new System.Management.Automation.ErrorRecord(innerException, string.Empty, System.Management.Automation.ErrorCategory.NotSpecified, null)); + } + + // a fault indicates an actual failure + SetJobState(JobState.Failed); + } + else + { + // otherwiser it's a completed state. + SetJobState(JobState.Completed); + } + }, CancellationToken); + } + + private void CheckForCancellation() + { + if (IsJobDone) + { + throw new LongRunningJobCancelledException("Long running job is canceled or stopping, continuation of the cmdlet is not permitted."); + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + CheckForCancellation(); + + this.Information.Add(informationRecord); + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public void WriteDebug(string text) + { + _statusMessage = text; + CheckForCancellation(); + + if (Debug.IsOpen && Debug.Count < MaxRecords) + { + Debug.Add(new DebugRecord(text)); + } + } + + public void WriteError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + + public void WriteObject(object sendToPipeline) + { + CheckForCancellation(); + + if (Output.IsOpen) + { + Output.Add(new PSObject(sendToPipeline)); + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + CheckForCancellation(); + + if (enumerateCollection && sendToPipeline is System.Collections.IEnumerable enumerable) + { + foreach (var item in enumerable) + { + WriteObject(item); + } + } + else + { + WriteObject(sendToPipeline); + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteVerbose(string text) + { + CheckForCancellation(); + + if (Verbose.IsOpen && Verbose.Count < MaxRecords) + { + Verbose.Add(new VerboseRecord(text)); + } + } + + public void WriteWarning(string text) + { + CheckForCancellation(); + + if (Warning.IsOpen && Warning.Count < MaxRecords) + { + Warning.Add(new WarningRecord(text)); + } + } + + public void WriteCommandDetail(string text) + { + WriteVerbose(text); + } + + public bool ShouldProcess(string target) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string target, string action) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + CheckForInteractive(); + shouldProcessReason = ShouldProcessReason.None; + return false; + } + + public bool ShouldContinue(string query, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public bool TransactionAvailable() + { + // interactivity required? + return false; + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/AsyncOperationResponse.cs b/swaggerci/storSimple1200Series/generated/runtime/AsyncOperationResponse.cs new file mode 100644 index 000000000000..644af080096d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/AsyncOperationResponse.cs @@ -0,0 +1,176 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + [System.ComponentModel.TypeConverter(typeof(AsyncOperationResponseTypeConverter))] + public class AsyncOperationResponse + { + private string _target; + public string Target { get => _target; set => _target = value; } + public AsyncOperationResponse() + { + } + internal AsyncOperationResponse(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json) + { + // pull target + { Target = If(json?.PropertyT("target"), out var _v) ? (string)_v : (string)Target; } + } + public string ToJsonString() + { + return $"{{ \"target\" : \"{this.Target}\" }}"; + } + + public static AsyncOperationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject json ? new AsyncOperationResponse(json) : null; + } + + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static AsyncOperationResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(jsonText)); + + } + + public partial class AsyncOperationResponseTypeConverter : System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to a type + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static object ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(AsyncOperationResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AsyncOperationResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString()); ; + } + catch + { + // Unable to use JSON pattern + } + + if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as System.Management.Automation.PSObject).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as global::System.Collections.IDictionary).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs new file mode 100644 index 000000000000..f16275a66b2f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs @@ -0,0 +1,113 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "CmdletSurface")] + [DoNotExport] + public class ExportCmdletSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CmdletFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool IncludeGeneralParameters { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetScriptCmdlets(this, CmdletFolder) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + foreach (var profileGroup in profileGroups) + { + var variantGroups = profileGroup.Variants + .GroupBy(v => new { v.CmdletName }) + .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), String.Empty, profileGroup.ProfileName)); + var sb = UseExpandedFormat ? ExpandedFormat(variantGroups) : CondensedFormat(variantGroups); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, $"CmdletSurface-{profileGroup.ProfileName}.md"), sb.ToString()); + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private StringBuilder ExpandedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + foreach (var variantGroup in variantGroups.OrderBy(vg => vg.CmdletName)) + { + sb.Append($"### {variantGroup.CmdletName}{Environment.NewLine}"); + var parameterGroups = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private StringBuilder CondensedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + var condensedGroups = variantGroups + .GroupBy(vg => vg.CmdletNoun) + .Select(vgg => ( + CmdletNoun: vgg.Key, + CmdletVerbs: vgg.Select(vg => vg.CmdletVerb).OrderBy(cv => cv).ToArray(), + ParameterGroups: vgg.SelectMany(vg => vg.ParameterGroups).DistinctBy(p => p.ParameterName).ToArray(), + OutputTypes: vgg.SelectMany(vg => vg.OutputTypes).Select(ot => ot.Type).DistinctBy(t => t.Name).Select(t => t.ToSyntaxTypeName()).ToArray())) + .OrderBy(vg => vg.CmdletNoun); + foreach (var condensedGroup in condensedGroups) + { + sb.Append($"### {condensedGroup.CmdletNoun} [{String.Join(", ", condensedGroup.CmdletVerbs)}] `{String.Join(", ", condensedGroup.OutputTypes)}`{Environment.NewLine}"); + var parameterGroups = condensedGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs new file mode 100644 index 000000000000..0b879423b92b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs @@ -0,0 +1,74 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ExampleStub")] + [DoNotExport] + public class ExportExampleStub : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + + var exampleText = String.Join(String.Empty, DefaultExampleHelpInfos.Select(ehi => ehi.ToHelpExampleOutput())); + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var cmdletFilePaths = GetScriptCmdlets(exportDirectory).Select(fi => Path.Combine(outputFolder, $"{fi.Name}.md")).ToArray(); + var currentExamplesFilePaths = Directory.GetFiles(outputFolder).ToArray(); + // Remove examples of non-existing cmdlets + var removedCmdletFilePaths = currentExamplesFilePaths.Except(cmdletFilePaths); + foreach (var removedCmdletFilePath in removedCmdletFilePaths) + { + File.Delete(removedCmdletFilePath); + } + + // Only create example stubs if they don't exist + foreach (var cmdletFilePath in cmdletFilePaths.Except(currentExamplesFilePaths)) + { + File.WriteAllText(cmdletFilePath, exampleText); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs new file mode 100644 index 000000000000..0cad4574b445 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -0,0 +1,101 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "FormatPs1xml")] + [DoNotExport] + public class ExportFormatPs1xml : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string FilePath { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support"; + private const string PropertiesExcludedForTableview = @""; + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + + protected override void ProcessRecord() + { + try + { + var viewModels = GetFilteredViewParameters().Select(CreateViewModel).ToList(); + var ps1xml = new Configuration + { + ViewDefinitions = new ViewDefinitions + { + Views = viewModels + } + }; + File.WriteAllText(FilePath, ps1xml.ToXmlString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static IEnumerable GetFilteredViewParameters() + { + //https://stackoverflow.com/a/79738/294804 + //https://stackoverflow.com/a/949285/294804 + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass + && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace)) + && !t.GetCustomAttributes().Any()); + return types.Select(t => new ViewParameters(t, t.GetProperties() + .Select(p => new PropertyFormat(p)) + .Where(pf => !pf.Property.GetCustomAttributes().Any() + && (!PropertiesExcludedForTableview.Split(',').Contains(pf.Property.Name)) + && (pf.FormatTable != null || (pf.Origin != PropertyOrigin.Inlined && pf.Property.PropertyType.IsPsSimple()))) + .OrderByDescending(pf => pf.Index.HasValue) + .ThenBy(pf => pf.Index) + .ThenByDescending(pf => pf.Origin.HasValue) + .ThenBy(pf => pf.Origin))).Where(vp => vp.Properties.Any()); + } + + private static View CreateViewModel(ViewParameters viewParameters) + { + var entries = viewParameters.Properties.Select(pf => + (TableColumnHeader: new TableColumnHeader { Label = pf.Label, Width = pf.Width }, + TableColumnItem: new TableColumnItem { PropertyName = pf.Property.Name })).ToArray(); + + return new View + { + Name = viewParameters.Type.FullName, + ViewSelectedBy = new ViewSelectedBy + { + TypeName = viewParameters.Type.FullName + }, + TableControl = new TableControl + { + TableHeaders = new TableHeaders + { + TableColumnHeaders = entries.Select(e => e.TableColumnHeader).ToList() + }, + TableRowEntries = new TableRowEntries + { + TableRowEntry = new TableRowEntry + { + TableColumnItems = new TableColumnItems + { + TableItems = entries.Select(e => e.TableColumnItem).ToList() + } + } + } + } + }; + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs new file mode 100644 index 000000000000..07943261b7f1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.MarkdownRenderer; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "HelpMarkdown")] + [DoNotExport] + public class ExportHelpMarkdown : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSModuleInfo ModuleInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] FunctionInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] HelpInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + protected override void ProcessRecord() + { + try + { + var helpInfos = HelpInfo.Select(hi => hi.ToPsHelpInfo()); + var variantGroups = FunctionInfo.Select(fi => fi.BaseObject).Cast() + .Join(helpInfos, fi => fi.Name, phi => phi.CmdletName, (fi, phi) => fi.ToVariants(phi)) + .Select(va => new VariantGroup(ModuleInfo.Name, va.First().CmdletName, va, String.Empty)); + WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs new file mode 100644 index 000000000000..2c3831888bda --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -0,0 +1,117 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ModelSurface")] + [DoNotExport] + public class ExportModelSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Support"; + + protected override void ProcessRecord() + { + try + { + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace))); + var typeInfos = types.Select(t => new ModelTypeInfo + { + Type = t, + TypeName = t.Name, + Properties = t.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => !p.GetIndexParameters().Any()).OrderBy(p => p.Name).ToArray(), + NamespaceGroup = t.Namespace.Split('.').LastOrDefault().EmptyIfNull() + }).Where(mti => mti.Properties.Any()); + var sb = UseExpandedFormat ? ExpandedFormat(typeInfos) : CondensedFormat(typeInfos); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, "ModelSurface.md"), sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static StringBuilder ExpandedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + foreach (var typeInfo in typeInfos.OrderBy(mti => mti.TypeName).ThenBy(mti => mti.NamespaceGroup)) + { + sb.Append($"### {typeInfo.TypeName} [{typeInfo.NamespaceGroup}]{Environment.NewLine}"); + foreach (var property in typeInfo.Properties) + { + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private static StringBuilder CondensedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + var typeGroups = typeInfos + .GroupBy(mti => mti.TypeName) + .Select(tig => ( + Types: tig.Select(mti => mti.Type).ToArray(), + TypeName: tig.Key, + Properties: tig.SelectMany(mti => mti.Properties).DistinctBy(p => p.Name).OrderBy(p => p.Name).ToArray(), + NamespaceGroups: tig.Select(mti => mti.NamespaceGroup).OrderBy(ng => ng).ToArray() + )) + .OrderBy(tg => tg.TypeName); + foreach (var typeGroup in typeGroups) + { + var aType = typeGroup.Types.Select(GetAssociativeType).FirstOrDefault(t => t != null); + var aText = aType != null ? $@" \<{aType.ToSyntaxTypeName()}\>" : String.Empty; + sb.Append($"### {typeGroup.TypeName}{aText} [{String.Join(", ", typeGroup.NamespaceGroups)}]{Environment.NewLine}"); + foreach (var property in typeGroup.Properties) + { + var propertyAType = GetAssociativeType(property.PropertyType); + var propertyAText = propertyAType != null ? $" <{propertyAType.ToSyntaxTypeName()}>" : String.Empty; + var enumNames = GetEnumFieldNames(property.PropertyType.Unwrap()); + var enumNamesText = enumNames.Any() ? $" **{{{String.Join(", ", enumNames)}}}**" : String.Empty; + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}{propertyAText}`{enumNamesText}{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + //https://stackoverflow.com/a/4963190/294804 + private static Type GetAssociativeType(Type type) => + type.GetInterfaces().FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>))?.GetGenericArguments().First(); + + private static string[] GetEnumFieldNames(Type type) => + type.IsValueType && !type.IsPrimitive && type != typeof(decimal) && type != typeof(DateTime) + ? type.GetFields(BindingFlags.Public | BindingFlags.Static).Where(f => f.FieldType == type).Select(p => p.Name).ToArray() + : new string[] { }; + + private class ModelTypeInfo + { + public Type Type { get; set; } + public string TypeName { get; set; } + public PropertyInfo[] Properties { get; set; } + public string NamespaceGroup { get; set; } + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs new file mode 100644 index 000000000000..19676676517d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -0,0 +1,169 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsHelpers; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.MarkdownRenderer; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsProxyTypeExtensions; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ProxyCmdlet", DefaultParameterSetName = "Docs")] + [DoNotExport] + public class ExportProxyCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string[] ModulePath { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string InternalFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [AllowEmptyString] + public string ModuleDescription { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + public Guid ModuleGuid { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "NoDocs")] + public SwitchParameter ExcludeDocs { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetModuleCmdletsAndHelpInfo(this, ModulePath).SelectMany(ci => ci.ToVariants()).Where(v => !v.IsDoNotExport).ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + var variantGroups = profileGroups.SelectMany(pg => pg.Variants + .GroupBy(v => new { v.CmdletName, v.IsInternal }) + .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + .ToArray(); + + var license = new StringBuilder(); + license.Append(@" +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +"); + HashSet LicenseSet = new HashSet(); + foreach (var variantGroup in variantGroups) + { + var parameterGroups = variantGroup.ParameterGroups.ToList(); + var isValidProfile = !String.IsNullOrEmpty(variantGroup.ProfileName) && variantGroup.ProfileName != NoProfiles; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, variantGroup.ProfileName) : ExamplesFolder; + var markdownInfo = new MarkdownHelpInfo(variantGroup, examplesFolder); + List examples = new List(); + foreach (var it in markdownInfo.Examples) + { + examples.Add(it); + } + variantGroup.HelpInfo.Examples = examples.ToArray(); + var sb = new StringBuilder(); + sb.Append($"{Environment.NewLine}"); + sb.Append(variantGroup.ToHelpCommentOutput()); + sb.Append($"function {variantGroup.CmdletName} {{{Environment.NewLine}"); + sb.Append(variantGroup.Aliases.ToAliasOutput()); + sb.Append(variantGroup.OutputTypes.ToOutputTypeOutput()); + sb.Append(variantGroup.ToCmdletBindingOutput()); + sb.Append(variantGroup.ProfileName.ToProfileOutput()); + + sb.Append("param("); + sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) + { + var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; + parameters = parameters.Where(p => !p.IsHidden()); + if (!parameters.Any()) + { + continue; + } + foreach (var parameter in parameters) + { + sb.Append(parameter.ToParameterOutput(variantGroup.HasMultipleVariants, parameterGroup.HasAllVariants)); + } + sb.Append(parameterGroup.Aliases.ToAliasOutput(true)); + sb.Append(parameterGroup.HasValidateNotNull.ToValidateNotNullOutput()); + sb.Append(parameterGroup.HasAllowEmptyArray.ToAllowEmptyArray()); + sb.Append(parameterGroup.CompleterInfo.ToArgumentCompleterOutput()); + sb.Append(parameterGroup.OrderCategory.ToParameterCategoryOutput()); + sb.Append(parameterGroup.InfoAttribute.ToInfoOutput(parameterGroup.ParameterType)); + sb.Append(parameterGroup.ToDefaultInfoOutput()); + sb.Append(parameterGroup.ParameterType.ToParameterTypeOutput()); + sb.Append(parameterGroup.Description.ToParameterDescriptionOutput()); + sb.Append(parameterGroup.ParameterName.ToParameterNameOutput(parameterGroups.IndexOf(parameterGroup) == parameterGroups.Count - 1)); + } + sb.Append($"){Environment.NewLine}{Environment.NewLine}"); + + sb.Append(variantGroup.ToBeginOutput()); + sb.Append(variantGroup.ToProcessOutput()); + sb.Append(variantGroup.ToEndOutput()); + + sb.Append($"}}{Environment.NewLine}"); + + Directory.CreateDirectory(variantGroup.OutputFolder); + File.WriteAllText(variantGroup.FilePath, license.ToString()); + File.AppendAllText(variantGroup.FilePath, sb.ToString()); + if (!LicenseSet.Contains(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"))) + { + // only add license in the header + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), license.ToString()); + LicenseSet.Add(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1")); + } + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), sb.ToString()); + } + + if (!ExcludeDocs) + { + var moduleInfo = new PsModuleHelpInfo(ModuleName, ModuleGuid, ModuleDescription); + foreach (var variantGroupsByProfile in variantGroups.GroupBy(vg => vg.ProfileName)) + { + var profileName = variantGroupsByProfile.Key; + var isValidProfile = !String.IsNullOrEmpty(profileName) && profileName != NoProfiles; + var docsFolder = isValidProfile ? Path.Combine(DocsFolder, profileName) : DocsFolder; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, profileName) : ExamplesFolder; + WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs new file mode 100644 index 000000000000..456c16fc0021 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -0,0 +1,191 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "Psd1")] + [DoNotExport] + public class ExportPsd1 : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CustomFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + [Parameter(Mandatory = true)] + public Guid ModuleGuid { get; set; } + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private const string CustomFolderRelative = "./custom"; + private const string Indent = Psd1Indent; + private const string Undefined = "undefined"; + private bool IsUndefined(string value) => string.Equals(Undefined, value, StringComparison.OrdinalIgnoreCase); + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + if (!Directory.Exists(CustomFolder)) + { + throw new ArgumentException($"Custom folder '{CustomFolder}' does not exist"); + } + + string version = Convert.ToString(@"0.1.0"); + // Validate the module version should be semantic version + // Following regex is official from https://semver.org/ + Regex rx = new Regex(@"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", RegexOptions.Compiled); + if (rx.Matches(version).Count != 1) + { + throw new ArgumentException("Module-version is not a valid Semantic Version"); + } + + string previewVersion = null; + if (version.Contains('-')) + { + string[] versions = version.Split("-".ToCharArray(), 2); + version = versions[0]; + previewVersion = versions[1]; + } + + var sb = new StringBuilder(); + sb.AppendLine("@{"); + sb.AppendLine($@"{GuidStart} = '{ModuleGuid}'"); + sb.AppendLine($@"{Indent}RootModule = '{"./Az.StorSimple.psm1"}'"); + sb.AppendLine($@"{Indent}ModuleVersion = '{version}'"); + sb.AppendLine($@"{Indent}CompatiblePSEditions = 'Core', 'Desktop'"); + sb.AppendLine($@"{Indent}Author = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}CompanyName = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}Copyright = '{"Microsoft Corporation. All rights reserved."}'"); + sb.AppendLine($@"{Indent}Description = '{"Microsoft Azure PowerShell: StorSimple cmdlets"}'"); + sb.AppendLine($@"{Indent}PowerShellVersion = '5.1'"); + sb.AppendLine($@"{Indent}DotNetFrameworkVersion = '4.7.2'"); + + // RequiredModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredModules = @({"undefined"})"); + } + + // RequiredAssemblies + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredAssemblies = @({"undefined"})"); + } + else + { + sb.AppendLine($@"{Indent}RequiredAssemblies = '{"./bin/Az.StorSimple.private.dll"}'"); + } + + // NestedModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}NestedModules = @({"undefined"})"); + } + + // FormatsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FormatsToProcess = @({"undefined"})"); + } + else + { + var customFormatPs1xmlFiles = Directory.GetFiles(CustomFolder) + .Where(f => f.EndsWith(".format.ps1xml")) + .Select(f => $"{CustomFolderRelative}/{Path.GetFileName(f)}"); + var formatList = customFormatPs1xmlFiles.Prepend("./Az.StorSimple.format.ps1xml").ToPsList(); + sb.AppendLine($@"{Indent}FormatsToProcess = {formatList}"); + } + + // TypesToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}TypesToProcess = @({"undefined"})"); + } + + // ScriptsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}ScriptsToProcess = @({"undefined"})"); + } + + var functionInfos = GetScriptCmdlets(ExportsFolder).ToArray(); + // FunctionsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FunctionsToExport = @({"undefined"})"); + } + else + { + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); + } + + // AliasesToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}AliasesToExport = @({"undefined"})"); + } + else + { + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } + + // CmdletsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}CmdletsToExport = @({"undefined"})"); + } + + sb.AppendLine($@"{Indent}PrivateData = @{{"); + sb.AppendLine($@"{Indent}{Indent}PSData = @{{"); + + if (previewVersion != null) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Prerelease = {previewVersion}"); + } + sb.AppendLine($@"{Indent}{Indent}{Indent}Tags = {"Azure ResourceManager ARM PSModule StorSimple".Split(' ').ToPsList().NullIfEmpty() ?? "''"}"); + sb.AppendLine($@"{Indent}{Indent}{Indent}LicenseUri = '{"https://aka.ms/azps-license"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ProjectUri = '{"https://github.com/Azure/azure-powershell"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ReleaseNotes = ''"); + var profilesList = ""; + if (IsAzure && !String.IsNullOrEmpty(profilesList)) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Profiles = {profilesList}"); + } + + sb.AppendLine($@"{Indent}{Indent}}}"); + sb.AppendLine($@"{Indent}}}"); + sb.AppendLine(@"}"); + + File.WriteAllText(Psd1Path, sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs new file mode 100644 index 000000000000..f89d64211bdc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -0,0 +1,148 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + if ($allChars) { + return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) + } else { + return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} +"); + File.WriteAllText(utilFile, sc.ToString()); + } + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath)" +); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} +"); + + + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); + + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs new file mode 100644 index 000000000000..ec3802dcff81 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "CommonParameter")] + [OutputType(typeof(Dictionary))] + [DoNotExport] + public class GetCommonParameter : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSCmdlet PSCmdlet { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public Dictionary PSBoundParameter { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = PSCmdlet.MyInvocation.MyCommand.ToVariants(); + var commonParameterNames = variants.ToParameterGroups() + .Where(pg => pg.OrderCategory == ParameterCategory.Azure || pg.OrderCategory == ParameterCategory.Runtime) + .Select(pg => pg.ParameterName); + if (variants.Any(v => v.SupportsShouldProcess)) + { + commonParameterNames = commonParameterNames.Append("Confirm").Append("WhatIf"); + } + if (variants.Any(v => v.SupportsPaging)) + { + commonParameterNames = commonParameterNames.Append("First").Append("Skip").Append("IncludeTotalCount"); + } + + var names = commonParameterNames.ToArray(); + var keys = PSBoundParameter.Keys.Where(k => names.Contains(k)); + WriteObject(keys.ToDictionary(key => key, key => PSBoundParameter[key]), true); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs new file mode 100644 index 000000000000..742a27aadbdd --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ModuleGuid")] + [DoNotExport] + public class GetModuleGuid : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + protected override void ProcessRecord() + { + try + { + WriteObject(ReadGuidFromPsd1(Psd1Path)); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs new file mode 100644 index 000000000000..7e5b38835326 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs @@ -0,0 +1,54 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ScriptCmdlet")] + [OutputType(typeof(string[]))] + [DoNotExport] + public class GetScriptCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ScriptFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeDoNotExport { get; set; } + + [Parameter] + public SwitchParameter AsAlias { get; set; } + + [Parameter] + public SwitchParameter AsFunctionInfo { get; set; } + + protected override void ProcessRecord() + { + try + { + var functionInfos = GetScriptCmdlets(this, ScriptFolder) + .Where(fi => IncludeDoNotExport || !fi.ScriptBlock.Attributes.OfType().Any()) + .ToArray(); + if (AsFunctionInfo) + { + WriteObject(functionInfos, true); + return; + } + var aliases = functionInfos.SelectMany(i => i.ScriptBlock.Attributes).ToAliasNames(); + var names = functionInfos.Select(fi => fi.Name).Distinct(); + var output = (AsAlias ? aliases : names).DefaultIfEmpty("''").ToArray(); + WriteObject(output, true); + } + catch (System.Exception ee) + { + System.Console.Error.WriteLine($"{ee.GetType().Name}: {ee.Message}"); + System.Console.Error.WriteLine(ee.StackTrace); + throw ee; + } + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/CollectionExtensions.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/CollectionExtensions.cs new file mode 100644 index 000000000000..52d9f04e2d3c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/CollectionExtensions.cs @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + internal static class CollectionExtensions + { + public static T[] NullIfEmpty(this T[] collection) => (collection?.Any() ?? false) ? collection : null; + public static IEnumerable EmptyIfNull(this IEnumerable collection) => collection ?? Enumerable.Empty(); + + // https://stackoverflow.com/a/4158364/294804 + public static IEnumerable DistinctBy(this IEnumerable collection, Func selector) => + collection.GroupBy(selector).Select(group => group.First()); + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/MarkdownRenderer.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/MarkdownRenderer.cs new file mode 100644 index 000000000000..a4e8bddad783 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -0,0 +1,114 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsProxyOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + internal static class MarkdownRenderer + { + public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder) + { + Directory.CreateDirectory(docsFolder); + var markdownInfos = variantGroups.Where(vg => !vg.IsInternal).Select(vg => new MarkdownHelpInfo(vg, examplesFolder)).OrderBy(mhi => mhi.CmdletName).ToArray(); + + foreach (var markdownInfo in markdownInfos) + { + var sb = new StringBuilder(); + sb.Append(markdownInfo.ToHelpMetadataOutput()); + sb.Append($"# {markdownInfo.CmdletName}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"## SYNOPSIS{Environment.NewLine}{markdownInfo.Synopsis.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## SYNTAX{Environment.NewLine}{Environment.NewLine}"); + var hasMultipleParameterSets = markdownInfo.SyntaxInfos.Length > 1; + foreach (var syntaxInfo in markdownInfo.SyntaxInfos) + { + sb.Append(syntaxInfo.ToHelpSyntaxOutput(hasMultipleParameterSets)); + } + + sb.Append($"## DESCRIPTION{Environment.NewLine}{markdownInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## EXAMPLES{Environment.NewLine}{Environment.NewLine}"); + foreach (var exampleInfo in markdownInfo.Examples) + { + sb.Append(exampleInfo.ToHelpExampleOutput()); + } + + sb.Append($"## PARAMETERS{Environment.NewLine}{Environment.NewLine}"); + foreach (var parameter in markdownInfo.Parameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + if (markdownInfo.SupportsShouldProcess) + { + foreach (var parameter in SupportsShouldProcessParameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + } + + sb.Append($"### CommonParameters{Environment.NewLine}This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## INPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var input in markdownInfo.Inputs) + { + sb.Append($"### {input}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## OUTPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var output in markdownInfo.Outputs) + { + sb.Append($"### {output}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## NOTES{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); + foreach (var alias in markdownInfo.Aliases) + { + sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); + } + if (markdownInfo.ComplexInterfaceInfos.Any()) + { + sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + } + foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + { + sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); + foreach (var relatedLink in markdownInfo.RelatedLinks) + { + sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); + } + + WriteModulePage(moduleHelpInfo, markdownInfos, docsFolder); + } + + private static void WriteModulePage(PsModuleHelpInfo moduleInfo, MarkdownHelpInfo[] markdownInfos, string docsFolder) + { + var sb = new StringBuilder(); + sb.Append(moduleInfo.ToModulePageMetadataOutput()); + sb.Append($"# {moduleInfo.Name} Module{Environment.NewLine}"); + sb.Append($"## Description{Environment.NewLine}{moduleInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## {moduleInfo.Name} Cmdlets{Environment.NewLine}"); + foreach (var markdownInfo in markdownInfos) + { + sb.Append(markdownInfo.ToModulePageCmdletOutput()); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{moduleInfo.Name}.md"), sb.ToString()); + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsFormatTypes.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsFormatTypes.cs new file mode 100644 index 000000000000..188ee8bac55f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsFormatTypes.cs @@ -0,0 +1,138 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + internal class ViewParameters + { + public Type Type { get; } + public IEnumerable Properties { get; } + + public ViewParameters(Type type, IEnumerable properties) + { + Type = type; + Properties = properties; + } + } + + internal class PropertyFormat + { + public PropertyInfo Property { get; } + public FormatTableAttribute FormatTable { get; } + + public int? Index { get; } + public string Label { get; } + public int? Width { get; } + public PropertyOrigin? Origin { get; } + + public PropertyFormat(PropertyInfo propertyInfo) + { + Property = propertyInfo; + FormatTable = Property.GetCustomAttributes().FirstOrDefault(); + var origin = Property.GetCustomAttributes().FirstOrDefault(); + + Index = FormatTable?.HasIndex ?? false ? (int?)FormatTable.Index : null; + Label = FormatTable?.Label ?? propertyInfo.Name; + Width = FormatTable?.HasWidth ?? false ? (int?)FormatTable.Width : null; + // If we have an index, we don't want to use Origin. + Origin = FormatTable?.HasIndex ?? false ? null : origin?.Origin; + } + } + + [Serializable] + [XmlRoot(nameof(Configuration))] + public class Configuration + { + [XmlElement("ViewDefinitions")] + public ViewDefinitions ViewDefinitions { get; set; } + } + + [Serializable] + public class ViewDefinitions + { + //https://stackoverflow.com/a/10518657/294804 + [XmlElement("View")] + public List Views { get; set; } + } + + [Serializable] + public class View + { + [XmlElement(nameof(Name))] + public string Name { get; set; } + [XmlElement(nameof(ViewSelectedBy))] + public ViewSelectedBy ViewSelectedBy { get; set; } + [XmlElement(nameof(TableControl))] + public TableControl TableControl { get; set; } + } + + [Serializable] + public class ViewSelectedBy + { + [XmlElement(nameof(TypeName))] + public string TypeName { get; set; } + } + + [Serializable] + public class TableControl + { + [XmlElement(nameof(TableHeaders))] + public TableHeaders TableHeaders { get; set; } + [XmlElement(nameof(TableRowEntries))] + public TableRowEntries TableRowEntries { get; set; } + } + + [Serializable] + public class TableHeaders + { + [XmlElement("TableColumnHeader")] + public List TableColumnHeaders { get; set; } + } + + [Serializable] + public class TableColumnHeader + { + [XmlElement(nameof(Label))] + public string Label { get; set; } + [XmlElement(nameof(Width))] + public int? Width { get; set; } + + //https://stackoverflow.com/a/4095225/294804 + public bool ShouldSerializeWidth() => Width.HasValue; + } + + [Serializable] + public class TableRowEntries + { + [XmlElement(nameof(TableRowEntry))] + public TableRowEntry TableRowEntry { get; set; } + } + + [Serializable] + public class TableRowEntry + { + [XmlElement(nameof(TableColumnItems))] + public TableColumnItems TableColumnItems { get; set; } + } + + [Serializable] + public class TableColumnItems + { + [XmlElement("TableColumnItem")] + public List TableItems { get; set; } + } + + [Serializable] + public class TableColumnItem + { + [XmlElement(nameof(PropertyName))] + public string PropertyName { get; set; } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs new file mode 100644 index 000000000000..24c685694055 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs @@ -0,0 +1,199 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + internal class HelpMetadataOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public HelpMetadataOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"--- +external help file:{(!String.IsNullOrEmpty(HelpInfo.ExternalHelpFilename) ? $" {HelpInfo.ExternalHelpFilename}" : String.Empty)} +Module Name: {HelpInfo.ModuleName} +online version: {HelpInfo.OnlineVersion} +schema: {HelpInfo.Schema.ToString(3)} +--- + +"; + } + + internal class HelpSyntaxOutput + { + public MarkdownSyntaxHelpInfo SyntaxInfo { get; } + public bool HasMultipleParameterSets { get; } + + public HelpSyntaxOutput(MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) + { + SyntaxInfo = syntaxInfo; + HasMultipleParameterSets = hasMultipleParameterSets; + } + + public override string ToString() + { + var psnText = HasMultipleParameterSets ? $"### {SyntaxInfo.ParameterSetName}{(SyntaxInfo.IsDefault ? " (Default)" : String.Empty)}{Environment.NewLine}" : String.Empty; + return $@"{psnText}``` +{SyntaxInfo.SyntaxText} +``` + +"; + } + } + + internal class HelpExampleOutput + { + private string ExampleTemplate = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + Environment.NewLine; + + private string ExampleTemplateWithOutput = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + "{6}" + Environment.NewLine + "{7}" + Environment.NewLine + Environment.NewLine + + "{8}" + Environment.NewLine + Environment.NewLine; + + public MarkdownExampleHelpInfo ExampleInfo { get; } + + public HelpExampleOutput(MarkdownExampleHelpInfo exampleInfo) + { + ExampleInfo = exampleInfo; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(ExampleInfo.Output)) + { + return string.Format(ExampleTemplate, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleInfo.Description.ToDescriptionFormat()); + } + else + { + return string.Format(ExampleTemplateWithOutput, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleOutputHeader, ExampleInfo.Output, ExampleOutputFooter, + ExampleInfo.Description.ToDescriptionFormat()); ; + } + } + } + + internal class HelpParameterOutput + { + public MarkdownParameterHelpInfo ParameterInfo { get; } + + public HelpParameterOutput(MarkdownParameterHelpInfo parameterInfo) + { + ParameterInfo = parameterInfo; + } + + public override string ToString() + { + var pipelineInputTypes = new[] + { + ParameterInfo.AcceptsPipelineByValue ? "ByValue" : String.Empty, + ParameterInfo.AcceptsPipelineByPropertyName ? "ByPropertyName" : String.Empty + }.JoinIgnoreEmpty(", "); + var pipelineInput = ParameterInfo.AcceptsPipelineByValue || ParameterInfo.AcceptsPipelineByPropertyName + ? $@"{true} ({pipelineInputTypes})" + : false.ToString(); + + return $@"### -{ParameterInfo.Name} +{ParameterInfo.Description.ToDescriptionFormat()} + +```yaml +Type: {ParameterInfo.Type.FullName} +Parameter Sets: {(ParameterInfo.HasAllParameterSets ? "(All)" : ParameterInfo.ParameterSetNames.JoinIgnoreEmpty(", "))} +Aliases:{(ParameterInfo.Aliases.Any() ? $" {ParameterInfo.Aliases.JoinIgnoreEmpty(", ")}" : String.Empty)} + +Required: {ParameterInfo.IsRequired} +Position: {ParameterInfo.Position} +Default value: {ParameterInfo.DefaultValue} +Accept pipeline input: {pipelineInput} +Accept wildcard characters: {ParameterInfo.AcceptsWildcardCharacters} +``` + +"; + } + } + + internal class ModulePageMetadataOutput + { + public PsModuleHelpInfo ModuleInfo { get; } + + private static string HelpLinkPrefix { get; } = @"https://docs.microsoft.com/en-us/powershell/module/"; + + public ModulePageMetadataOutput(PsModuleHelpInfo moduleInfo) + { + ModuleInfo = moduleInfo; + } + + public override string ToString() => $@"--- +Module Name: {ModuleInfo.Name} +Module Guid: {ModuleInfo.Guid} +Download Help Link: {HelpLinkPrefix}{ModuleInfo.Name.ToLowerInvariant()} +Help Version: 1.0.0.0 +Locale: en-US +--- + +"; + } + + internal class ModulePageCmdletOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public ModulePageCmdletOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"### [{HelpInfo.CmdletName}]({HelpInfo.CmdletName}.md) +{HelpInfo.Synopsis.ToDescriptionFormat()} + +"; + } + + internal static class PsHelpOutputExtensions + { + public static string EscapeAngleBrackets(this string text) => text?.Replace("<", @"\<").Replace(">", @"\>"); + public static string ReplaceSentenceEndWithNewline(this string text) => text?.Replace(". ", $".{Environment.NewLine}").Replace(". ", $".{Environment.NewLine}"); + public static string ReplaceBrWithNewline(this string text) => text?.Replace("
", $"{Environment.NewLine}"); + public static string ToDescriptionFormat(this string text, bool escapeAngleBrackets = true) + { + var description = text?.ReplaceBrWithNewline(); + description = escapeAngleBrackets ? description?.EscapeAngleBrackets() : description; + return description?.ReplaceSentenceEndWithNewline().Trim(); + } + + public const string ExampleNameHeader = "### "; + public const string ExampleCodeHeader = "```powershell"; + public const string ExampleCodeFooter = "```"; + public const string ExampleOutputHeader = "```output"; + public const string ExampleOutputFooter = "```"; + + public static HelpMetadataOutput ToHelpMetadataOutput(this MarkdownHelpInfo helpInfo) => new HelpMetadataOutput(helpInfo); + + public static HelpSyntaxOutput ToHelpSyntaxOutput(this MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) => new HelpSyntaxOutput(syntaxInfo, hasMultipleParameterSets); + + public static HelpExampleOutput ToHelpExampleOutput(this MarkdownExampleHelpInfo exampleInfo) => new HelpExampleOutput(exampleInfo); + + public static HelpParameterOutput ToHelpParameterOutput(this MarkdownParameterHelpInfo parameterInfo) => new HelpParameterOutput(parameterInfo); + + public static ModulePageMetadataOutput ToModulePageMetadataOutput(this PsModuleHelpInfo moduleInfo) => new ModulePageMetadataOutput(moduleInfo); + + public static ModulePageCmdletOutput ToModulePageCmdletOutput(this MarkdownHelpInfo helpInfo) => new ModulePageCmdletOutput(helpInfo); + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsHelpTypes.cs new file mode 100644 index 000000000000..ff6e238e9b76 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsHelpTypes.cs @@ -0,0 +1,202 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + internal class PsHelpInfo + { + public string CmdletName { get; } + public string ModuleName { get; } + public string Synopsis { get; } + public string Description { get; } + public string AlertText { get; } + public string Category { get; } + public PsHelpLinkInfo OnlineVersion { get; } + public PsHelpLinkInfo[] RelatedLinks { get; } + public bool? HasCommonParameters { get; } + public bool? HasWorkflowCommonParameters { get; } + + public PsHelpTypeInfo[] InputTypes { get; } + public PsHelpTypeInfo[] OutputTypes { get; } + public PsHelpExampleInfo[] Examples { get; set; } + public string[] Aliases { get; } + + public PsParameterHelpInfo[] Parameters { get; } + public PsHelpSyntaxInfo[] Syntax { get; } + + public object Component { get; } + public object Functionality { get; } + public object PsSnapIn { get; } + public object Role { get; } + public string NonTerminatingErrors { get; } + + public PsHelpInfo(PSObject helpObject = null) + { + helpObject = helpObject ?? new PSObject(); + CmdletName = helpObject.GetProperty("Name").NullIfEmpty() ?? helpObject.GetNestedProperty("details", "name"); + ModuleName = helpObject.GetProperty("ModuleName"); + Synopsis = helpObject.GetProperty("Synopsis"); + Description = helpObject.GetProperty("description").EmptyIfNull().ToDescriptionText().NullIfEmpty() ?? + helpObject.GetNestedProperty("details", "description").EmptyIfNull().ToDescriptionText(); + AlertText = helpObject.GetNestedProperty("alertSet", "alert").EmptyIfNull().ToDescriptionText(); + Category = helpObject.GetProperty("Category"); + HasCommonParameters = helpObject.GetProperty("CommonParameters").ToNullableBool(); + HasWorkflowCommonParameters = helpObject.GetProperty("WorkflowCommonParameters").ToNullableBool(); + + var links = helpObject.GetNestedProperty("relatedLinks", "navigationLink").EmptyIfNull().Select(nl => nl.ToLinkInfo()).ToArray(); + OnlineVersion = links.FirstOrDefault(l => l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length == 1); + RelatedLinks = links.Where(l => !l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length != 1).ToArray(); + + InputTypes = helpObject.GetNestedProperty("inputTypes", "inputType").EmptyIfNull().Select(it => it.ToTypeInfo()).ToArray(); + OutputTypes = helpObject.GetNestedProperty("returnValues", "returnValue").EmptyIfNull().Select(rv => rv.ToTypeInfo()).ToArray(); + Examples = helpObject.GetNestedProperty("examples", "example").EmptyIfNull().Select(e => e.ToExampleInfo()).ToArray(); + Aliases = helpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); + + Parameters = helpObject.GetNestedProperty("parameters", "parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + Syntax = helpObject.GetNestedProperty("syntax", "syntaxItem").EmptyIfNull().Select(si => si.ToSyntaxInfo()).ToArray(); + + Component = helpObject.GetProperty("Component"); + Functionality = helpObject.GetProperty("Functionality"); + PsSnapIn = helpObject.GetProperty("PSSnapIn"); + Role = helpObject.GetProperty("Role"); + NonTerminatingErrors = helpObject.GetProperty("nonTerminatingErrors"); + } + } + + internal class PsHelpTypeInfo + { + public string Name { get; } + public string Description { get; } + + public PsHelpTypeInfo(PSObject typeObject) + { + Name = typeObject.GetNestedProperty("type", "name").EmptyIfNull().Trim(); + Description = typeObject.GetProperty("description").EmptyIfNull().ToDescriptionText(); + } + } + + internal class PsHelpLinkInfo + { + public string Uri { get; } + public string Text { get; } + + public PsHelpLinkInfo(PSObject linkObject) + { + Uri = linkObject.GetProperty("uri"); + Text = linkObject.GetProperty("linkText"); + } + } + + internal class PsHelpSyntaxInfo + { + public string CmdletName { get; } + public PsParameterHelpInfo[] Parameters { get; } + + public PsHelpSyntaxInfo(PSObject syntaxObject) + { + CmdletName = syntaxObject.GetProperty("name"); + Parameters = syntaxObject.GetProperty("parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + } + } + + internal class PsHelpExampleInfo + { + public string Title { get; } + public string Code { get; } + public string Output { get; } + public string Remarks { get; } + + public PsHelpExampleInfo(PSObject exampleObject) + { + Title = exampleObject.GetProperty("title"); + Code = exampleObject.GetProperty("code"); + Output = exampleObject.GetProperty("output"); + Remarks = exampleObject.GetProperty("remarks").EmptyIfNull().ToDescriptionText(); + } + public PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) + { + Title = markdownExample.Name; + Code = markdownExample.Code; + Output = markdownExample.Output; + Remarks = markdownExample.Description; + } + + public static implicit operator PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) => new PsHelpExampleInfo(markdownExample); + } + + internal class PsParameterHelpInfo + { + public string DefaultValueAsString { get; } + + public string Name { get; } + public string TypeName { get; } + public string Description { get; } + public string SupportsPipelineInput { get; } + public string PositionText { get; } + public string[] ParameterSetNames { get; } + public string[] Aliases { get; } + + public bool? SupportsGlobbing { get; } + public bool? IsRequired { get; } + public bool? IsVariableLength { get; } + public bool? IsDynamic { get; } + + public PsParameterHelpInfo(PSObject parameterHelpObject = null) + { + parameterHelpObject = parameterHelpObject ?? new PSObject(); + DefaultValueAsString = parameterHelpObject.GetProperty("defaultValue"); + Name = parameterHelpObject.GetProperty("name"); + TypeName = parameterHelpObject.GetProperty("parameterValue").NullIfEmpty() ?? parameterHelpObject.GetNestedProperty("type", "name"); + Description = parameterHelpObject.GetProperty("Description").EmptyIfNull().ToDescriptionText(); + SupportsPipelineInput = parameterHelpObject.GetProperty("pipelineInput"); + PositionText = parameterHelpObject.GetProperty("position"); + ParameterSetNames = parameterHelpObject.GetProperty("parameterSetName").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + Aliases = parameterHelpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + + SupportsGlobbing = parameterHelpObject.GetProperty("globbing").ToNullableBool(); + IsRequired = parameterHelpObject.GetProperty("required").ToNullableBool(); + IsVariableLength = parameterHelpObject.GetProperty("variableLength").ToNullableBool(); + IsDynamic = parameterHelpObject.GetProperty("isDynamic").ToNullableBool(); + } + } + + internal class PsModuleHelpInfo + { + public string Name { get; } + public Guid Guid { get; } + public string Description { get; } + + public PsModuleHelpInfo(PSModuleInfo moduleInfo) + : this(moduleInfo?.Name ?? String.Empty, moduleInfo?.Guid ?? Guid.NewGuid(), moduleInfo?.Description ?? String.Empty) + { + } + + public PsModuleHelpInfo(string name, Guid guid, string description) + { + Name = name; + Guid = guid; + Description = description; + } + } + + internal static class HelpTypesExtensions + { + public static PsHelpInfo ToPsHelpInfo(this PSObject helpObject) => new PsHelpInfo(helpObject); + public static PsParameterHelpInfo ToPsParameterHelpInfo(this PSObject parameterHelpObject) => new PsParameterHelpInfo(parameterHelpObject); + + public static string ToDescriptionText(this IEnumerable descriptionObject) => descriptionObject != null + ? String.Join(Environment.NewLine, descriptionObject.Select(dl => dl.GetProperty("Text").EmptyIfNull())).NullIfWhiteSpace() + : null; + public static PsHelpTypeInfo ToTypeInfo(this PSObject typeObject) => new PsHelpTypeInfo(typeObject); + public static PsHelpExampleInfo ToExampleInfo(this PSObject exampleObject) => new PsHelpExampleInfo(exampleObject); + public static PsHelpLinkInfo ToLinkInfo(this PSObject linkObject) => new PsHelpLinkInfo(linkObject); + public static PsHelpSyntaxInfo ToSyntaxInfo(this PSObject syntaxObject) => new PsHelpSyntaxInfo(syntaxObject); + public static PsModuleHelpInfo ToModuleInfo(this PSModuleInfo moduleInfo) => new PsModuleHelpInfo(moduleInfo); + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs new file mode 100644 index 000000000000..681493e56ccc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -0,0 +1,294 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + internal class MarkdownHelpInfo + { + public string ExternalHelpFilename { get; } + public string ModuleName { get; } + public string OnlineVersion { get; } + public Version Schema { get; } + + public string CmdletName { get; } + public string[] Aliases { get; } + public string Synopsis { get; } + public string Description { get; } + + public MarkdownSyntaxHelpInfo[] SyntaxInfos { get; } + public MarkdownExampleHelpInfo[] Examples { get; } + public MarkdownParameterHelpInfo[] Parameters { get; } + + public string[] Inputs { get; } + public string[] Outputs { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + public string[] RelatedLinks { get; } + + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string externalHelpFilename = "") + { + ExternalHelpFilename = externalHelpFilename; + ModuleName = variantGroup.RootModuleName != "" ? variantGroup.RootModuleName : variantGroup.ModuleName; + var helpInfo = variantGroup.HelpInfo; + var commentInfo = variantGroup.CommentInfo; + Schema = Version.Parse("2.0.0"); + + CmdletName = variantGroup.CmdletName; + Aliases = (variantGroup.Aliases.NullIfEmpty() ?? helpInfo.Aliases).Where(a => a != "None").ToArray(); + Synopsis = commentInfo.Synopsis; + Description = commentInfo.Description; + + SyntaxInfos = variantGroup.Variants + .Select(v => new MarkdownSyntaxHelpInfo(v, variantGroup.ParameterGroups, v.VariantName == variantGroup.DefaultParameterSetName)) + .OrderByDescending(v => v.IsDefault).ThenBy(v => v.ParameterSetName).ToArray(); + Examples = GetExamplesFromMarkdown(examplesFolder).NullIfEmpty() + ?? helpInfo.Examples.Select(e => e.ToExampleHelpInfo()).ToArray().NullIfEmpty() + ?? DefaultExampleHelpInfos; + + Parameters = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && !pg.Parameters.All(p => p.IsHidden())) + .Select(pg => new MarkdownParameterHelpInfo( + variantGroup.Variants.SelectMany(v => v.HelpInfo.Parameters).Where(phi => phi.Name == pg.ParameterName).ToArray(), pg)) + .OrderBy(phi => phi.Name).ToArray(); + + Inputs = commentInfo.Inputs; + Outputs = commentInfo.Outputs; + + ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; + OnlineVersion = commentInfo.OnlineVersion; + RelatedLinks = commentInfo.RelatedLinks; + + SupportsShouldProcess = variantGroup.SupportsShouldProcess; + SupportsPaging = variantGroup.SupportsPaging; + } + + private MarkdownExampleHelpInfo[] GetExamplesFromMarkdown(string examplesFolder) + { + var filePath = Path.Combine(examplesFolder, $"{CmdletName}.md"); + if (!Directory.Exists(examplesFolder) || !File.Exists(filePath)) return null; + + var lines = File.ReadAllLines(filePath); + var nameIndices = lines.Select((l, i) => l.StartsWith(ExampleNameHeader) ? i : -1).Where(i => i != -1).ToArray(); + //https://codereview.stackexchange.com/a/187148/68772 + var indexCountGroups = nameIndices.Skip(1).Append(lines.Length).Zip(nameIndices, (next, current) => (NameIndex: current, LineCount: next - current)); + var exampleGroups = indexCountGroups.Select(icg => lines.Skip(icg.NameIndex).Take(icg.LineCount).ToArray()); + return exampleGroups.Select(eg => + { + var name = eg.First().Replace(ExampleNameHeader, String.Empty); + var codeStartIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var codeEndIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i != codeStartIndex); + var code = codeStartIndex.HasValue && codeEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(codeStartIndex.Value + 1).Take(codeEndIndex.Value - (codeStartIndex.Value + 1))) + : String.Empty; + var outputStartIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var outputEndIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i > outputStartIndex); + var output = outputStartIndex.HasValue && outputEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(outputStartIndex.Value + 1).Take(outputEndIndex.Value - (outputStartIndex.Value + 1))) + : String.Empty; + var descriptionStartIndex = (outputEndIndex ?? (codeEndIndex ?? 0)) + 1; + descriptionStartIndex = String.IsNullOrWhiteSpace(eg[descriptionStartIndex]) ? descriptionStartIndex + 1 : descriptionStartIndex; + var descriptionEndIndex = eg.Length - 1; + descriptionEndIndex = String.IsNullOrWhiteSpace(eg[descriptionEndIndex]) ? descriptionEndIndex - 1 : descriptionEndIndex; + var description = String.Join(Environment.NewLine, eg.Skip(descriptionStartIndex).Take((descriptionEndIndex + 1) - descriptionStartIndex)); + return new MarkdownExampleHelpInfo(name, code, output, description); + }).ToArray(); + } + } + + internal class MarkdownSyntaxHelpInfo + { + public Variant Variant { get; } + public bool IsDefault { get; } + public string ParameterSetName { get; } + public Parameter[] Parameters { get; } + public string SyntaxText { get; } + + public MarkdownSyntaxHelpInfo(Variant variant, ParameterGroup[] parameterGroups, bool isDefault) + { + Variant = variant; + IsDefault = isDefault; + ParameterSetName = Variant.VariantName; + Parameters = Variant.Parameters + .Where(p => !p.DontShow && !p.IsHidden()).OrderByDescending(p => p.IsMandatory) + //https://stackoverflow.com/a/6461526/294804 + .ThenByDescending(p => p.Position.HasValue).ThenBy(p => p.Position) + // Use the OrderCategory of the parameter group because the final order category is the highest of the group, and not the order category of the individual parameters from the variants. + .ThenBy(p => parameterGroups.First(pg => pg.ParameterName == p.ParameterName).OrderCategory).ThenBy(p => p.ParameterName).ToArray(); + SyntaxText = CreateSyntaxFormat(); + } + + //https://github.com/PowerShell/platyPS/blob/a607a926bfffe1e1a1e53c19e0057eddd0c07611/src/Markdown.MAML/Renderer/Markdownv2Renderer.cs#L29-L32 + private const int SyntaxLineWidth = 110; + private string CreateSyntaxFormat() + { + var parameterStrings = Parameters.Select(p => p.ToPropertySyntaxOutput().ToString()); + if (Variant.SupportsShouldProcess) + { + parameterStrings = parameterStrings.Append(" [-Confirm]").Append(" [-WhatIf]"); + } + parameterStrings = parameterStrings.Append(" []"); + + var lines = new List(20); + return parameterStrings.Aggregate(Variant.CmdletName, (current, ps) => + { + var combined = current + ps; + if (combined.Length <= SyntaxLineWidth) return combined; + + lines.Add(current); + return ps; + }, last => + { + lines.Add(last); + return String.Join(Environment.NewLine, lines); + }); + } + } + + internal class MarkdownExampleHelpInfo + { + public string Name { get; } + public string Code { get; } + public string Output { get; } + public string Description { get; } + + public MarkdownExampleHelpInfo(string name, string code, string output, string description) + { + Name = name; + Code = code; + Output = output; + Description = description; + } + } + + internal class MarkdownParameterHelpInfo + { + public string Name { get; set; } + public string Description { get; set; } + public Type Type { get; set; } + public string Position { get; set; } + public string DefaultValue { get; set; } + + public bool HasAllParameterSets { get; set; } + public string[] ParameterSetNames { get; set; } + public string[] Aliases { get; set; } + + public bool IsRequired { get; set; } + public bool IsDynamic { get; set; } + public bool AcceptsPipelineByValue { get; set; } + public bool AcceptsPipelineByPropertyName { get; set; } + public bool AcceptsWildcardCharacters { get; set; } + + // For use by common parameters that have no backing data in the objects themselves. + public MarkdownParameterHelpInfo() { } + + public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, ParameterGroup parameterGroup) + { + Name = parameterGroup.ParameterName; + Description = parameterGroup.Description.NullIfEmpty() + ?? parameterHelpInfos.Select(phi => phi.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + Type = parameterGroup.ParameterType; + Position = parameterGroup.FirstPosition?.ToString() + ?? parameterHelpInfos.Select(phi => phi.PositionText).FirstOrDefault(d => !String.IsNullOrEmpty(d)).ToUpperFirstCharacter().NullIfEmpty() + ?? "Named"; + // This no longer uses firstHelpInfo.DefaultValueAsString since it seems to be broken. For example, it has a value of 0 for Int32, but no default value was declared. + DefaultValue = parameterGroup.DefaultInfo?.Script ?? "None"; + + HasAllParameterSets = parameterGroup.HasAllVariants; + ParameterSetNames = (parameterGroup.Parameters.Select(p => p.VariantName).ToArray().NullIfEmpty() + ?? parameterHelpInfos.SelectMany(phi => phi.ParameterSetNames).Distinct()) + .OrderBy(psn => psn).ToArray(); + Aliases = parameterGroup.Aliases.NullIfEmpty() ?? parameterHelpInfos.SelectMany(phi => phi.Aliases).ToArray(); + + IsRequired = parameterHelpInfos.Select(phi => phi.IsRequired).FirstOrDefault(r => r == true) ?? parameterGroup.Parameters.Any(p => p.IsMandatory); + IsDynamic = parameterHelpInfos.Select(phi => phi.IsDynamic).FirstOrDefault(d => d == true) ?? false; + AcceptsPipelineByValue = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByValue")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipeline; + AcceptsPipelineByPropertyName = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByPropertyName")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipelineByPropertyName; + AcceptsWildcardCharacters = parameterGroup.SupportsWildcards; + } + } + + internal static class MarkdownTypesExtensions + { + public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks); + + public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos = + { + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + }; + + public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = + { + new MarkdownParameterHelpInfo + { + Name = "Confirm", + Description ="Prompts you for confirmation before running the cmdlet.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "cf" } + }, + new MarkdownParameterHelpInfo + { + Name = "WhatIf", + Description ="Shows what would happen if the cmdlet runs. The cmdlet is not run.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "wi" } + } + }; + + public static MarkdownParameterHelpInfo[] SupportsPagingParameters = + { + new MarkdownParameterHelpInfo + { + Name = "First", + Description ="Gets only the first 'n' objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "IncludeTotalCount", + Description ="Reports the number of objects in the data set (an integer) followed by the objects. If the cmdlet cannot determine the total count, it returns \"Unknown total count\".", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "Skip", + Description ="Ignores the first 'n' objects and then gets the remaining objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + } + }; + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsProxyOutputs.cs new file mode 100644 index 000000000000..cea31bbd3e5c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -0,0 +1,611 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + internal class OutputTypeOutput + { + public PSTypeName[] OutputTypes { get; } + + public OutputTypeOutput(IEnumerable outputTypes) + { + OutputTypes = outputTypes.ToArray(); + } + + public override string ToString() => OutputTypes != null && OutputTypes.Any() ? $"[OutputType({OutputTypes.Select(ot => $"[{ot}]").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class CmdletBindingOutput + { + public VariantGroup VariantGroup { get; } + + public CmdletBindingOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + + public override string ToString() + { + var dpsText = VariantGroup.DefaultParameterSetName.IsValidDefaultParameterSetName() ? $"DefaultParameterSetName='{VariantGroup.DefaultParameterSetName}'" : String.Empty; + var sspText = VariantGroup.SupportsShouldProcess ? $"SupportsShouldProcess{ItemSeparator}ConfirmImpact='Medium'" : String.Empty; + var pbText = $"PositionalBinding={false.ToPsBool()}"; + var propertyText = new[] { dpsText, pbText, sspText }.JoinIgnoreEmpty(ItemSeparator); + return $"[CmdletBinding({propertyText})]{Environment.NewLine}"; + } + } + + internal class ParameterOutput + { + public Parameter Parameter { get; } + public bool HasMultipleVariantsInVariantGroup { get; } + public bool HasAllVariantsInParameterGroup { get; } + + public ParameterOutput(Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) + { + Parameter = parameter; + HasMultipleVariantsInVariantGroup = hasMultipleVariantsInVariantGroup; + HasAllVariantsInParameterGroup = hasAllVariantsInParameterGroup; + } + + public override string ToString() + { + var psnText = HasMultipleVariantsInVariantGroup && !HasAllVariantsInParameterGroup ? $"ParameterSetName='{Parameter.VariantName}'" : String.Empty; + var positionText = Parameter.Position != null ? $"Position={Parameter.Position}" : String.Empty; + var mandatoryText = Parameter.IsMandatory ? "Mandatory" : String.Empty; + var dontShowText = Parameter.DontShow ? "DontShow" : String.Empty; + var vfpText = Parameter.ValueFromPipeline ? "ValueFromPipeline" : String.Empty; + var vfpbpnText = Parameter.ValueFromPipelineByPropertyName ? "ValueFromPipelineByPropertyName" : String.Empty; + var propertyText = new[] { psnText, positionText, mandatoryText, dontShowText, vfpText, vfpbpnText }.JoinIgnoreEmpty(ItemSeparator); + return $"{Indent}[Parameter({propertyText})]{Environment.NewLine}"; + } + } + + internal class AliasOutput + { + public string[] Aliases { get; } + public bool IncludeIndent { get; } + + public AliasOutput(string[] aliases, bool includeIndent = false) + { + Aliases = aliases; + IncludeIndent = includeIndent; + } + + public override string ToString() => Aliases?.Any() ?? false ? $"{(IncludeIndent ? Indent : String.Empty)}[Alias({Aliases.Select(an => $"'{an}'").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class ValidateNotNullOutput + { + public bool HasValidateNotNull { get; } + + public ValidateNotNullOutput(bool hasValidateNotNull) + { + HasValidateNotNull = hasValidateNotNull; + } + + public override string ToString() => HasValidateNotNull ? $"{Indent}[ValidateNotNull()]{Environment.NewLine}" : String.Empty; + } + + internal class AllowEmptyArrayOutput + { + public bool HasAllowEmptyArray { get; } + + public AllowEmptyArrayOutput(bool hasAllowEmptyArray) + { + HasAllowEmptyArray = hasAllowEmptyArray; + } + + public override string ToString() => HasAllowEmptyArray ? $"{Indent}[AllowEmptyCollection()]{Environment.NewLine}" : String.Empty; + } + internal class ArgumentCompleterOutput + { + public CompleterInfo CompleterInfo { get; } + + public ArgumentCompleterOutput(CompleterInfo completerInfo) + { + CompleterInfo = completerInfo; + } + + public override string ToString() => CompleterInfo != null + ? $"{Indent}[ArgumentCompleter({(CompleterInfo.IsTypeCompleter ? $"[{CompleterInfo.Type.Unwrap().ToPsType()}]" : $"{{{CompleterInfo.Script.ToPsSingleLine("; ")}}}")})]{Environment.NewLine}" + : String.Empty; + } + + internal class DefaultInfoOutput + { + public bool HasDefaultInfo { get; } + public DefaultInfo DefaultInfo { get; } + + public DefaultInfoOutput(ParameterGroup parameterGroup) + { + HasDefaultInfo = parameterGroup.HasDefaultInfo; + DefaultInfo = parameterGroup.DefaultInfo; + } + + public override string ToString() + { + var nameText = !String.IsNullOrEmpty(DefaultInfo?.Name) ? $"Name='{DefaultInfo?.Name}'" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(DefaultInfo?.Description) ? $"Description='{DefaultInfo?.Description.ToPsStringLiteral()}'" : String.Empty; + var scriptText = !String.IsNullOrEmpty(DefaultInfo?.Script) ? $"Script='{DefaultInfo?.Script.ToPsSingleLine("; ")}'" : String.Empty; + var propertyText = new[] { nameText, descriptionText, scriptText }.JoinIgnoreEmpty(ItemSeparator); + return HasDefaultInfo ? $"{Indent}[{typeof(DefaultInfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class ParameterTypeOutput + { + public Type ParameterType { get; } + + public ParameterTypeOutput(Type parameterType) + { + ParameterType = parameterType; + } + + public override string ToString() => $"{Indent}[{ParameterType.ToPsType()}]{Environment.NewLine}"; + } + + internal class ParameterNameOutput + { + public string ParameterName { get; } + public bool IsLast { get; } + + public ParameterNameOutput(string parameterName, bool isLast) + { + ParameterName = parameterName; + IsLast = isLast; + } + + public override string ToString() => $"{Indent}${{{ParameterName}}}{(IsLast ? String.Empty : $",{Environment.NewLine}")}{Environment.NewLine}"; + } + + internal class BaseOutput + { + public VariantGroup VariantGroup { get; } + + protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + public string ClearTelemetryContext() + { + return (!VariantGroup.IsInternal && IsAzure) ? $@"{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()" : ""; + } + } + + internal class BeginOutput : BaseOutput + { + public BeginOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + public string GetProcessCustomAttributesAtRuntime() + { + return VariantGroup.IsInternal ? "" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; + } + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() +{Indent}{Indent}}} +{Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}{Indent}if ($internalCalledCmdlets -eq '') {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' +{Indent}{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"begin {{ +{Indent}try {{ +{Indent}{Indent}$outBuffer = $null +{Indent}{Indent}if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {{ +{Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 +{Indent}{Indent}}} +{Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName +{GetTelemetry()} +{GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} +{GetProcessCustomAttributesAtRuntime()} +{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} +{Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) +{Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} + +"; + + private string GetParameterSetToCmdletMapping() + { + var sb = new StringBuilder(); + sb.AppendLine($"{Indent}{Indent}$mapping = @{{"); + foreach (var variant in VariantGroup.Variants) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}{variant.VariantName} = '{variant.PrivateModuleName}\{variant.PrivateCmdletName}';"); + } + sb.Append($"{Indent}{Indent}}}"); + return sb.ToString(); + } + + private string GetDefaultValuesStatements() + { + var defaultInfos = VariantGroup.ParameterGroups.Where(pg => pg.HasDefaultInfo).Select(pg => pg.DefaultInfo).ToArray(); + var sb = new StringBuilder(); + + foreach (var defaultInfo in defaultInfos) + { + var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); + var parameterName = defaultInfo.ParameterGroup.ParameterName; + sb.AppendLine(); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.Append($"{Indent}{Indent}}}"); + } + return sb.ToString(); + } + } + + internal class ProcessOutput : BaseOutput + { + public ProcessOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetFinally() + { + if (IsAzure && !VariantGroup.IsInternal) + { + return $@" +{Indent}finally {{ +{Indent}{Indent}$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"process {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.Process($_) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +{GetFinally()} +}} +"; + } + + internal class EndOutput : BaseOutput + { + public EndOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.StorSimple.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}{Indent}}} +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId +"; + } + return ""; + } + public override string ToString() => $@"end {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.End() +{GetTelemetry()} +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} +"; + } + + internal class HelpCommentOutput + { + public VariantGroup VariantGroup { get; } + public CommentInfo CommentInfo { get; } + + public HelpCommentOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + CommentInfo = variantGroup.CommentInfo; + } + + public override string ToString() + { + var inputs = String.Join(Environment.NewLine, CommentInfo.Inputs.Select(i => $".Inputs{Environment.NewLine}{i}")); + var inputsText = !String.IsNullOrEmpty(inputs) ? $"{Environment.NewLine}{inputs}" : String.Empty; + var outputs = String.Join(Environment.NewLine, CommentInfo.Outputs.Select(o => $".Outputs{Environment.NewLine}{o}")); + var outputsText = !String.IsNullOrEmpty(outputs) ? $"{Environment.NewLine}{outputs}" : String.Empty; + var notes = String.Join($"{Environment.NewLine}{Environment.NewLine}", VariantGroup.ComplexInterfaceInfos.Select(cii => cii.ToNoteOutput())); + var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; + var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); + var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var examples = ""; + foreach (var example in VariantGroup.HelpInfo.Examples) + { + examples = examples + ".Example" + "\r\n" + example.Code + "\r\n"; + } + return $@"<# +.Synopsis +{CommentInfo.Synopsis.ToDescriptionFormat(false)} +.Description +{CommentInfo.Description.ToDescriptionFormat(false)} +{examples}{inputsText}{outputsText}{notesText} +.Link +{CommentInfo.OnlineVersion}{relatedLinksText} +#> +"; + } + } + + internal class ParameterDescriptionOutput + { + public string Description { get; } + + public ParameterDescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) + ? Description.ToDescriptionFormat(false).NormalizeNewLines() + .Split(new[] { Environment.NewLine }, StringSplitOptions.None) + .Aggregate(String.Empty, (c, n) => c + $"{Indent}# {n}{Environment.NewLine}") + : String.Empty; + } + + internal class ProfileOutput + { + public string ProfileName { get; } + + public ProfileOutput(string profileName) + { + ProfileName = profileName; + } + + public override string ToString() => ProfileName != NoProfiles ? $"[{typeof(ProfileAttribute).ToPsAttributeType()}('{ProfileName}')]{Environment.NewLine}" : String.Empty; + } + + internal class DescriptionOutput + { + public string Description { get; } + + public DescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) ? $"[{typeof(DescriptionAttribute).ToPsAttributeType()}('{Description.ToPsStringLiteral()}')]{Environment.NewLine}" : String.Empty; + } + + internal class ParameterCategoryOutput + { + public ParameterCategory Category { get; } + + public ParameterCategoryOutput(ParameterCategory category) + { + Category = category; + } + + public override string ToString() => $"{Indent}[{typeof(CategoryAttribute).ToPsAttributeType()}('{Category}')]{Environment.NewLine}"; + } + + internal class InfoOutput + { + public InfoAttribute Info { get; } + public Type ParameterType { get; } + + public InfoOutput(InfoAttribute info, Type parameterType) + { + Info = info; + ParameterType = parameterType; + } + + public override string ToString() + { + // Rendering of InfoAttribute members that are not used currently + /*var serializedNameText = Info.SerializedName != null ? $"SerializedName='{Info.SerializedName}'" : String.Empty; + var readOnlyText = Info.ReadOnly ? "ReadOnly" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(Info.Description) ? $"Description='{Info.Description.ToPsStringLiteral()}'" : String.Empty;*/ + + var requiredText = Info.Required ? "Required" : String.Empty; + var unwrappedType = ParameterType.Unwrap(); + var hasValidPossibleTypes = Info.PossibleTypes.Any(pt => pt != unwrappedType); + var possibleTypesText = hasValidPossibleTypes + ? $"PossibleTypes=({Info.PossibleTypes.Select(pt => $"[{pt.ToPsType()}]").JoinIgnoreEmpty(ItemSeparator)})" + : String.Empty; + var propertyText = new[] { /*serializedNameText, */requiredText,/* readOnlyText,*/ possibleTypesText/*, descriptionText*/ }.JoinIgnoreEmpty(ItemSeparator); + return hasValidPossibleTypes ? $"{Indent}[{typeof(InfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class PropertySyntaxOutput + { + public string ParameterName { get; } + public Type ParameterType { get; } + public bool IsMandatory { get; } + public int? Position { get; } + + public bool IncludeSpace { get; } + public bool IncludeDash { get; } + + public PropertySyntaxOutput(Parameter parameter) + { + ParameterName = parameter.ParameterName; + ParameterType = parameter.ParameterType; + IsMandatory = parameter.IsMandatory; + Position = parameter.Position; + IncludeSpace = true; + IncludeDash = true; + } + + public PropertySyntaxOutput(ComplexInterfaceInfo complexInterfaceInfo) + { + ParameterName = complexInterfaceInfo.Name; + ParameterType = complexInterfaceInfo.Type; + IsMandatory = complexInterfaceInfo.Required; + Position = null; + IncludeSpace = false; + IncludeDash = false; + } + + public override string ToString() + { + var leftOptional = !IsMandatory ? "[" : String.Empty; + var leftPositional = Position != null ? "[" : String.Empty; + var rightPositional = Position != null ? "]" : String.Empty; + var type = ParameterType != typeof(SwitchParameter) ? $" <{ParameterType.ToSyntaxTypeName()}>" : String.Empty; + var rightOptional = !IsMandatory ? "]" : String.Empty; + var space = IncludeSpace ? " " : String.Empty; + var dash = IncludeDash ? "-" : String.Empty; + return $"{space}{leftOptional}{leftPositional}{dash}{ParameterName}{rightPositional}{type}{rightOptional}"; + } + } + + internal static class PsProxyOutputExtensions + { + public const string NoParameters = "__NoParameters"; + + public const string AllParameterSets = "__AllParameterSets"; + + public const string HalfIndent = " "; + + public const string Indent = HalfIndent + HalfIndent; + + public const string ItemSeparator = ", "; + + public static readonly string ComplexParameterHeader = $"COMPLEX PARAMETER PROPERTIES{Environment.NewLine}{Environment.NewLine}To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.{Environment.NewLine}{Environment.NewLine}"; + + public static string ToPsBool(this bool value) => $"${value.ToString().ToLowerInvariant()}"; + + public static string ToPsType(this Type type) + { + var regex = new Regex(@"^(.*)`{1}\d+(.*)$"); + var typeText = type.ToString(); + var match = regex.Match(typeText); + return match.Success ? $"{match.Groups[1]}{match.Groups[2]}" : typeText; + } + + public static string ToPsAttributeType(this Type type) => type.ToPsType().RemoveEnd("Attribute"); + + // https://stackoverflow.com/a/5284606/294804 + private static string RemoveEnd(this string text, string suffix) => text.EndsWith(suffix) ? text.Substring(0, text.Length - suffix.Length) : text; + + public static string ToPsSingleLine(this string value, string replacer = " ") => value.ReplaceNewLines(replacer, new[] { "
", "\r\n", "\n" }); + + public static string ToPsStringLiteral(this string value) => value?.Replace("'", "''").Replace("‘", "''").Replace("’", "''").ToPsSingleLine().Trim() ?? String.Empty; + + public static string JoinIgnoreEmpty(this IEnumerable values, string separator) => String.Join(separator, values?.Where(v => !String.IsNullOrEmpty(v))); + + // https://stackoverflow.com/a/41961738/294804 + public static string ToSyntaxTypeName(this Type type) + { + if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + return $"{type.GetGenericArguments().First().ToSyntaxTypeName()}?"; + } + + if (type.IsGenericType) + { + var genericTypes = String.Join(ItemSeparator, type.GetGenericArguments().Select(ToSyntaxTypeName)); + return $"{type.Name.Split('`').First()}<{genericTypes}>"; + } + + return type.Name; + } + + public static OutputTypeOutput ToOutputTypeOutput(this IEnumerable outputTypes) => new OutputTypeOutput(outputTypes); + + public static CmdletBindingOutput ToCmdletBindingOutput(this VariantGroup variantGroup) => new CmdletBindingOutput(variantGroup); + + public static ParameterOutput ToParameterOutput(this Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) => new ParameterOutput(parameter, hasMultipleVariantsInVariantGroup, hasAllVariantsInParameterGroup); + + public static AliasOutput ToAliasOutput(this string[] aliases, bool includeIndent = false) => new AliasOutput(aliases, includeIndent); + + public static ValidateNotNullOutput ToValidateNotNullOutput(this bool hasValidateNotNull) => new ValidateNotNullOutput(hasValidateNotNull); + + public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); + + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + + public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); + + public static ParameterTypeOutput ToParameterTypeOutput(this Type parameterType) => new ParameterTypeOutput(parameterType); + + public static ParameterNameOutput ToParameterNameOutput(this string parameterName, bool isLast) => new ParameterNameOutput(parameterName, isLast); + + public static BeginOutput ToBeginOutput(this VariantGroup variantGroup) => new BeginOutput(variantGroup); + + public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput(variantGroup); + + public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput(variantGroup); + + public static HelpCommentOutput ToHelpCommentOutput(this VariantGroup variantGroup) => new HelpCommentOutput(variantGroup); + + public static ParameterDescriptionOutput ToParameterDescriptionOutput(this string description) => new ParameterDescriptionOutput(description); + + public static ProfileOutput ToProfileOutput(this string profileName) => new ProfileOutput(profileName); + + public static DescriptionOutput ToDescriptionOutput(this string description) => new DescriptionOutput(description); + + public static ParameterCategoryOutput ToParameterCategoryOutput(this ParameterCategory category) => new ParameterCategoryOutput(category); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this Parameter parameter) => new PropertySyntaxOutput(parameter); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this ComplexInterfaceInfo complexInterfaceInfo) => new PropertySyntaxOutput(complexInterfaceInfo); + + public static InfoOutput ToInfoOutput(this InfoAttribute info, Type parameterType) => new InfoOutput(info, parameterType); + + public static string ToNoteOutput(this ComplexInterfaceInfo complexInterfaceInfo, string currentIndent = "", bool includeDashes = false, bool includeBackticks = false, bool isFirst = true) + { + string RenderProperty(ComplexInterfaceInfo info, string indent, bool dash, bool backtick) => + $"{indent}{(dash ? "- " : String.Empty)}{(backtick ? "`" : String.Empty)}{info.ToPropertySyntaxOutput()}{(backtick ? "`" : String.Empty)}: {info.Description}"; + + var nested = complexInterfaceInfo.NestedInfos.Select(ni => + { + var nestedIndent = $"{currentIndent}{HalfIndent}"; + return ni.IsComplexInterface + ? ni.ToNoteOutput(nestedIndent, includeDashes, includeBackticks, false) + : RenderProperty(ni, nestedIndent, includeDashes, includeBackticks); + }).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, !isFirst && includeBackticks)); + return String.Join(Environment.NewLine, nested); + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsProxyTypes.cs new file mode 100644 index 000000000000..782b0e491144 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -0,0 +1,514 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + internal class ProfileGroup + { + public string ProfileName { get; } + public Variant[] Variants { get; } + public string ProfileFolder { get; } + + public ProfileGroup(Variant[] variants, string profileName = NoProfiles) + { + ProfileName = profileName; + Variants = variants; + ProfileFolder = ProfileName != NoProfiles ? ProfileName : String.Empty; + } + } + + internal class VariantGroup + { + public string ModuleName { get; } + + public string RootModuleName {get => @"";} + public string CmdletName { get; } + public string CmdletVerb { get; } + public string CmdletNoun { get; } + public string ProfileName { get; } + public Variant[] Variants { get; } + public ParameterGroup[] ParameterGroups { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + + public string[] Aliases { get; } + public PSTypeName[] OutputTypes { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + public string DefaultParameterSetName { get; } + public bool HasMultipleVariants { get; } + public PsHelpInfo HelpInfo { get; } + public bool IsGenerated { get; } + public bool IsInternal { get; } + + public string OutputFolder { get; } + public string FileName { get; } + public string FilePath { get; } + + public CommentInfo CommentInfo { get; } + + public VariantGroup(string moduleName, string cmdletName, Variant[] variants, string outputFolder, string profileName = NoProfiles, bool isTest = false, bool isInternal = false) + { + ModuleName = moduleName; + CmdletName = cmdletName; + var cmdletNameParts = CmdletName.Split('-'); + CmdletVerb = cmdletNameParts.First(); + CmdletNoun = cmdletNameParts.Last(); + ProfileName = profileName; + Variants = variants; + ParameterGroups = Variants.ToParameterGroups().OrderBy(pg => pg.OrderCategory).ThenByDescending(pg => pg.IsMandatory).ToArray(); + var aliasDuplicates = ParameterGroups.SelectMany(pg => pg.Aliases) + //https://stackoverflow.com/a/18547390/294804 + .GroupBy(a => a).Where(g => g.Count() > 1).Select(g => g.Key).ToArray(); + if (aliasDuplicates.Any()) + { + throw new ParsingMetadataException($"The alias(es) [{String.Join(", ", aliasDuplicates)}] are defined on multiple parameters for cmdlet '{CmdletName}', which is not supported."); + } + ComplexInterfaceInfos = ParameterGroups.Where(pg => !pg.DontShow && pg.IsComplexInterface).OrderBy(pg => pg.ParameterName).Select(pg => pg.ComplexInterfaceInfo).ToArray(); + + Aliases = Variants.SelectMany(v => v.Attributes).ToAliasNames().ToArray(); + OutputTypes = Variants.SelectMany(v => v.Info.OutputType).Where(ot => ot.Type != null).GroupBy(ot => ot.Type).Select(otg => otg.First()).ToArray(); + SupportsShouldProcess = Variants.Any(v => v.SupportsShouldProcess); + SupportsPaging = Variants.Any(v => v.SupportsPaging); + DefaultParameterSetName = DetermineDefaultParameterSetName(); + HasMultipleVariants = Variants.Length > 1; + HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); + IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); + IsInternal = isInternal; + + OutputFolder = outputFolder; + FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; + FilePath = Path.Combine(OutputFolder, FileName); + + CommentInfo = new CommentInfo(this); + } + + private string DetermineDefaultParameterSetName() + { + var defaultParameterSet = Variants + .Select(v => v.Metadata.DefaultParameterSetName) + .LastOrDefault(dpsn => dpsn.IsValidDefaultParameterSetName()); + + if (String.IsNullOrEmpty(defaultParameterSet)) + { + var variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); + var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); + defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; + } + + return defaultParameterSet; + } + } + + internal class Variant + { + public string CmdletName { get; } + public string VariantName { get; } + public CommandInfo Info { get; } + public CommandMetadata Metadata { get; } + public PsHelpInfo HelpInfo { get; } + public bool HasParameterSets { get; } + public bool IsFunction { get; } + public string PrivateModuleName { get; } + public string PrivateCmdletName { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public Attribute[] Attributes { get; } + public Parameter[] Parameters { get; } + public Parameter[] CmdletOnlyParameters { get; } + public bool IsInternal { get; } + public bool IsDoNotExport { get; } + public string[] Profiles { get; } + + public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) + { + CmdletName = cmdletName; + VariantName = variantName; + Info = info; + HelpInfo = helpInfo ?? new PsHelpInfo(); + Metadata = metadata; + HasParameterSets = hasParameterSets; + IsFunction = Info.CommandType == CommandTypes.Function; + PrivateModuleName = Info.Source; + PrivateCmdletName = Metadata.Name; + SupportsShouldProcess = Metadata.SupportsShouldProcess; + SupportsPaging = Metadata.SupportsPaging; + + Attributes = this.ToAttributes(); + Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); + IsInternal = Attributes.OfType().Any(); + IsDoNotExport = Attributes.OfType().Any(); + CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); + Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); + } + } + + internal class ParameterGroup + { + public string ParameterName { get; } + public Parameter[] Parameters { get; } + + public string[] VariantNames { get; } + public string[] AllVariantNames { get; } + public bool HasAllVariants { get; } + public Type ParameterType { get; } + public string Description { get; } + + public string[] Aliases { get; } + public bool HasValidateNotNull { get; } + public bool HasAllowEmptyArray { get; } + public CompleterInfo CompleterInfo { get; } + public DefaultInfo DefaultInfo { get; } + public bool HasDefaultInfo { get; } + public ParameterCategory OrderCategory { get; } + public bool DontShow { get; } + public bool IsMandatory { get; } + public bool SupportsWildcards { get; } + public bool IsComplexInterface { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public InfoAttribute InfoAttribute { get; } + + public int? FirstPosition { get; } + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public bool IsInputType { get; } + + public ParameterGroup(string parameterName, Parameter[] parameters, string[] allVariantNames) + { + ParameterName = parameterName; + Parameters = parameters; + + VariantNames = Parameters.Select(p => p.VariantName).ToArray(); + AllVariantNames = allVariantNames; + HasAllVariants = VariantNames.Any(vn => vn == AllParameterSets) || !AllVariantNames.Except(VariantNames).Any(); + var types = Parameters.Select(p => p.ParameterType).Distinct().ToArray(); + if (types.Length > 1) + { + throw new ParsingMetadataException($"The parameter '{ParameterName}' has multiple parameter types [{String.Join(", ", types.Select(t => t.Name))}] defined, which is not supported."); + } + ParameterType = types.First(); + Description = Parameters.Select(p => p.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + + Aliases = Parameters.SelectMany(p => p.Attributes).ToAliasNames().ToArray(); + HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); + HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); + CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); + DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) + ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); + HasDefaultInfo = DefaultInfo != null && !String.IsNullOrEmpty(DefaultInfo.Script); + // When DefaultInfo is present, force all parameters from this group to be optional. + if (HasDefaultInfo) + { + foreach (var parameter in Parameters) + { + parameter.IsMandatory = false; + } + } + OrderCategory = Parameters.Select(p => p.OrderCategory).Distinct().DefaultIfEmpty(ParameterCategory.Body).Min(); + DontShow = Parameters.All(p => p.DontShow); + IsMandatory = HasAllVariants && Parameters.Any(p => p.IsMandatory); + SupportsWildcards = Parameters.Any(p => p.SupportsWildcards); + IsComplexInterface = Parameters.Any(p => p.IsComplexInterface); + ComplexInterfaceInfo = Parameters.Where(p => p.IsComplexInterface).Select(p => p.ComplexInterfaceInfo).FirstOrDefault(); + InfoAttribute = Parameters.Select(p => p.InfoAttribute).First(); + + FirstPosition = Parameters.Select(p => p.Position).FirstOrDefault(p => p != null); + ValueFromPipeline = Parameters.Any(p => p.ValueFromPipeline); + ValueFromPipelineByPropertyName = Parameters.Any(p => p.ValueFromPipelineByPropertyName); + IsInputType = ValueFromPipeline || ValueFromPipelineByPropertyName; + } + } + + internal class Parameter + { + public string VariantName { get; } + public string ParameterName { get; } + public ParameterMetadata Metadata { get; } + public PsParameterHelpInfo HelpInfo { get; } + public Type ParameterType { get; } + + public Attribute[] Attributes { get; } + public ParameterCategory[] Categories { get; } + public ParameterCategory OrderCategory { get; } + public PSDefaultValueAttribute DefaultValueAttribute { get; } + public DefaultInfoAttribute DefaultInfoAttribute { get; } + public ParameterAttribute ParameterAttribute { get; } + public bool SupportsWildcards { get; } + public CompleterInfoAttribute CompleterInfoAttribute { get; } + public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public int? Position { get; } + public bool DontShow { get; } + public bool IsMandatory { get; set; } + + public InfoAttribute InfoAttribute { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public bool IsComplexInterface { get; } + public string Description { get; } + + public Parameter(string variantName, string parameterName, ParameterMetadata metadata, PsParameterHelpInfo helpInfo = null) + { + VariantName = variantName; + ParameterName = parameterName; + Metadata = metadata; + HelpInfo = helpInfo ?? new PsParameterHelpInfo(); + + Attributes = Metadata.Attributes.ToArray(); + ParameterType = Attributes.OfType().FirstOrDefault()?.Type ?? Metadata.ParameterType; + Categories = Attributes.OfType().SelectMany(ca => ca.Categories).Distinct().ToArray(); + OrderCategory = Categories.DefaultIfEmpty(ParameterCategory.Body).Min(); + DefaultValueAttribute = Attributes.OfType().FirstOrDefault(); + DefaultInfoAttribute = Attributes.OfType().FirstOrDefault(); + ParameterAttribute = Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == VariantName || pa.ParameterSetName == AllParameterSets); + if (ParameterAttribute == null) + { + throw new ParsingMetadataException($"The variant '{VariantName}' has multiple parameter sets defined, which is not supported."); + } + SupportsWildcards = Attributes.OfType().Any(); + CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + + ValueFromPipeline = ParameterAttribute.ValueFromPipeline; + ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; + Position = ParameterAttribute.Position == Int32.MinValue ? (int?)null : ParameterAttribute.Position; + DontShow = ParameterAttribute.DontShow; + IsMandatory = ParameterAttribute.Mandatory; + + var complexParameterName = ParameterName.ToUpperInvariant(); + var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; + // Remove the complex type message as it will be reinserted if this is a complex type + description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + // Make an InfoAttribute for processing only if one isn't provided + InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; + // Set the description if the InfoAttribute does not have one since they are exported without a description + InfoAttribute.Description = String.IsNullOrEmpty(InfoAttribute.Description) ? description : InfoAttribute.Description; + ComplexInterfaceInfo = InfoAttribute.ToComplexInterfaceInfo(complexParameterName, ParameterType, true); + IsComplexInterface = ComplexInterfaceInfo.IsComplexInterface; + Description = $"{description}{(IsComplexInterface ? complexMessage : String.Empty)}"; + } + } + + internal class ComplexInterfaceInfo + { + public InfoAttribute InfoAttribute { get; } + + public string Name { get; } + public Type Type { get; } + public bool Required { get; } + public bool ReadOnly { get; } + public string Description { get; } + + public ComplexInterfaceInfo[] NestedInfos { get; } + public bool IsComplexInterface { get; } + + public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, bool? required, List seenTypes) + { + Name = name; + Type = type; + InfoAttribute = infoAttribute; + + Required = required ?? InfoAttribute.Required; + ReadOnly = InfoAttribute.ReadOnly; + Description = InfoAttribute.Description.ToPsSingleLine(); + + var unwrappedType = Type.Unwrap(); + var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; + (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + unwrappedType.GetInterfaces() + .Concat(InfoAttribute.PossibleTypes) + .SelectMany(pt => pt.GetProperties() + .SelectMany(pi => pi.GetCustomAttributes(true).OfType() + .Select(ia => ia.ToComplexInterfaceInfo(pi.Name, pi.PropertyType, seenTypes: seenTypes)))) + .Where(cii => !cii.ReadOnly).OrderByDescending(cii => cii.Required).ToArray(); + // https://stackoverflow.com/a/503359/294804 + var associativeArrayInnerType = Type.GetInterfaces() + .FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>)) + ?.GetTypeInfo().GetGenericArguments().First(); + if (!hasBeenSeen && associativeArrayInnerType != null) + { + var anyInfo = new InfoAttribute { Description = "This indicates any property can be added to this object." }; + NestedInfos = NestedInfos.Prepend(anyInfo.ToComplexInterfaceInfo("(Any)", associativeArrayInnerType)).ToArray(); + } + IsComplexInterface = NestedInfos.Any(); + } + } + + internal class CommentInfo + { + public string Description { get; } + public string Synopsis { get; } + + public string[] Examples { get; } + public string[] Inputs { get; } + public string[] Outputs { get; } + + public string OnlineVersion { get; } + public string[] RelatedLinks { get; } + + private const string HelpLinkPrefix = @"https://docs.microsoft.com/en-us/powershell/module/"; + + public CommentInfo(VariantGroup variantGroup) + { + var helpInfo = variantGroup.HelpInfo; + Description = variantGroup.Variants.SelectMany(v => v.Attributes).OfType().FirstOrDefault()?.Description.NullIfEmpty() + ?? helpInfo.Description.EmptyIfNull(); + // If there is no Synopsis, PowerShell may put in the Syntax string as the Synopsis. This seems unintended, so we remove the Synopsis in this situation. + var synopsis = helpInfo.Synopsis.EmptyIfNull().Trim().StartsWith(variantGroup.CmdletName) ? String.Empty : helpInfo.Synopsis; + Synopsis = synopsis.NullIfEmpty() ?? Description; + + Examples = helpInfo.Examples.Select(rl => rl.Code).ToArray(); + + Inputs = (variantGroup.ParameterGroups.Where(pg => pg.IsInputType).Select(pg => pg.ParameterType.FullName).ToArray().NullIfEmpty() ?? + helpInfo.InputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(it => it.Name).ToArray()) + .Where(i => i != "None").Distinct().OrderBy(i => i).ToArray(); + Outputs = (variantGroup.OutputTypes.Select(ot => ot.Type.FullName).ToArray().NullIfEmpty() ?? + helpInfo.OutputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(ot => ot.Name).ToArray()) + .Where(o => o != "None").Distinct().OrderBy(o => o).ToArray(); + + // Use root module name in the help link + var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); + OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; + RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + } + } + + internal class CompleterInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public Type Type { get; } + public bool IsTypeCompleter { get; } + + public CompleterInfo(CompleterInfoAttribute infoAttribute) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + } + + public CompleterInfo(ArgumentCompleterAttribute completerAttribute) + { + Script = completerAttribute.ScriptBlock?.ToString(); + if (completerAttribute.Type != null) + { + Type = completerAttribute.Type; + IsTypeCompleter = true; + } + } + } + + internal class DefaultInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public ParameterGroup ParameterGroup { get; } + + public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + ParameterGroup = parameterGroup; + } + + public DefaultInfo(PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) + { + Description = defaultValueAttribute.Help; + ParameterGroup = parameterGroup; + if (defaultValueAttribute.Value != null) + { + Script = defaultValueAttribute.Value.ToString(); + } + } + } + + internal static class PsProxyTypeExtensions + { + public const string NoProfiles = "__NoProfiles"; + + public static bool IsValidDefaultParameterSetName(this string parameterSetName) => + !String.IsNullOrEmpty(parameterSetName) && parameterSetName != AllParameterSets; + + public static Variant[] ToVariants(this CommandInfo info, PsHelpInfo helpInfo) + { + var metadata = new CommandMetadata(info); + var privateCmdletName = metadata.Name.Split('!').First(); + var parts = privateCmdletName.Split('_'); + return parts.Length > 1 + ? new[] { new Variant(parts[0], parts[1], info, metadata, helpInfo: helpInfo) } + // Process multiple parameter sets, so we declare a variant per parameter set. + : info.ParameterSets.Select(ps => new Variant(privateCmdletName, ps.Name, info, metadata, true, helpInfo)).ToArray(); + } + + public static Variant[] ToVariants(this CmdletAndHelpInfo info) => info.CommandInfo.ToVariants(info.HelpInfo); + + public static Variant[] ToVariants(this CommandInfo info, PSObject helpInfo = null) => info.ToVariants(helpInfo?.ToPsHelpInfo()); + + public static Parameter[] ToParameters(this Variant variant) + { + var parameters = variant.Metadata.Parameters.AsEnumerable(); + var parameterHelp = variant.HelpInfo.Parameters.AsEnumerable(); + + if (variant.HasParameterSets) + { + parameters = parameters.Where(p => p.Value.ParameterSets.Keys.Any(k => k == variant.VariantName || k == AllParameterSets)); + parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); + } + var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); + if (variant.SupportsPaging) { + // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters + variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; + variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; + result = result.Append(new Parameter(variant.VariantName, "First", variant.Info.Parameters["First"], parameterHelp.FirstOrDefault(ph => ph.Name == "First"))); + result = result.Append(new Parameter(variant.VariantName, "Skip", variant.Info.Parameters["Skip"], parameterHelp.FirstOrDefault(ph => ph.Name == "Skip"))); + } + return result.ToArray(); + } + + public static Attribute[] ToAttributes(this Variant variant) => variant.IsFunction + ? ((FunctionInfo)variant.Info).ScriptBlock.Attributes.ToArray() + : variant.Metadata.CommandType.GetCustomAttributes(false).Cast().ToArray(); + + public static IEnumerable ToParameterGroups(this Variant[] variants) + { + var allVariantNames = variants.Select(vg => vg.VariantName).ToArray(); + return variants + .SelectMany(v => v.Parameters) + .GroupBy(p => p.ParameterName, StringComparer.InvariantCultureIgnoreCase) + .Select(pg => new ParameterGroup(pg.Key, pg.Select(p => p).ToArray(), allVariantNames)); + } + + public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute infoAttribute, string name, Type type, bool? required = null, List seenTypes = null) + => new ComplexInterfaceInfo(name, type, infoAttribute, required, seenTypes); + + public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); + public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); + + public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); + public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/PsAttributes.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/PsAttributes.cs new file mode 100644 index 000000000000..7763b9121535 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/PsAttributes.cs @@ -0,0 +1,114 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple +{ + [AttributeUsage(AttributeTargets.Class)] + public class DescriptionAttribute : Attribute + { + public string Description { get; } + + public DescriptionAttribute(string description) + { + Description = description; + } + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class InternalExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class GeneratedAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotFormatAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class ProfileAttribute : Attribute + { + public string[] Profiles { get; } + + public ProfileAttribute(params string[] profiles) + { + Profiles = profiles; + } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class CategoryAttribute : Attribute + { + public ParameterCategory[] Categories { get; } + + public CategoryAttribute(params ParameterCategory[] categories) + { + Categories = categories; + } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class ExportAsAttribute : Attribute + { + public Type Type { get; set; } + + public ExportAsAttribute(Type type) + { + Type = type; + } + } + + public enum ParameterCategory + { + // Note: Order is significant + Uri = 0, + Path, + Query, + Header, + Cookie, + Body, + Azure, + Runtime + } + + [AttributeUsage(AttributeTargets.Property)] + public class OriginAttribute : Attribute + { + public PropertyOrigin Origin { get; } + + public OriginAttribute(PropertyOrigin origin) + { + Origin = origin; + } + } + + public enum PropertyOrigin + { + // Note: Order is significant + Inherited = 0, + Owned, + Inlined + } + + [AttributeUsage(AttributeTargets.Property)] + public class FormatTableAttribute : Attribute + { + public int Index { get; set; } = -1; + public bool HasIndex => Index != -1; + public string Label { get; set; } + public int Width { get; set; } = -1; + public bool HasWidth => Width != -1; + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/PsExtensions.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/PsExtensions.cs new file mode 100644 index 000000000000..f9d77935e28b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/PsExtensions.cs @@ -0,0 +1,169 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + internal static class PsExtensions + { + // https://stackoverflow.com/a/863944/294804 + // https://stackoverflow.com/a/4452598/294804 + // https://stackoverflow.com/a/28701974/294804 + // Note: This will unwrap nested collections, but we don't generate nested collections. + public static Type Unwrap(this Type type) + { + if (type.IsArray) + { + return type.GetElementType().Unwrap(); + } + + var typeInfo = type.GetTypeInfo(); + if (typeInfo.IsGenericType + && (typeInfo.GetGenericTypeDefinition() == typeof(Nullable<>) || typeof(IEnumerable<>).IsAssignableFrom(type))) + { + return typeInfo.GetGenericArguments().First().Unwrap(); + } + + return type; + } + + // https://stackoverflow.com/a/863944/294804 + private static bool IsSimple(this Type type) + { + var typeInfo = type.GetTypeInfo(); + return typeInfo.IsPrimitive + || typeInfo.IsEnum + || type == typeof(string) + || type == typeof(decimal); + } + + // https://stackoverflow.com/a/32025393/294804 + private static bool HasImplicitConversion(this Type baseType, Type targetType) => + baseType.GetMethods(BindingFlags.Public | BindingFlags.Static) + .Where(mi => mi.Name == "op_Implicit" && mi.ReturnType == targetType) + .Any(mi => mi.GetParameters().FirstOrDefault()?.ParameterType == baseType); + + public static bool IsPsSimple(this Type type) + { + var unwrappedType = type.Unwrap(); + return unwrappedType.IsSimple() + || unwrappedType == typeof(SwitchParameter) + || unwrappedType == typeof(Hashtable) + || unwrappedType == typeof(PSCredential) + || unwrappedType == typeof(ScriptBlock) + || unwrappedType == typeof(DateTime) + || unwrappedType == typeof(Uri) + || unwrappedType.HasImplicitConversion(typeof(string)); + } + + public static string ToPsList(this IEnumerable items) => String.Join(", ", items.Select(i => $"'{i}'")); + + public static IEnumerable ToAliasNames(this IEnumerable attributes) => attributes.OfType().SelectMany(aa => aa.AliasNames).Distinct(); + + public static bool IsArrayAndElementTypeIsT(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return itemType.IsArray && !tType.IsArray && tType.IsAssignableFrom(itemType.GetElementType()); + } + + public static bool IsTArrayAndElementTypeIsItem(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return !itemType.IsArray && tType.IsArray && (tType.GetElementType()?.IsAssignableFrom(itemType) ?? false); + } + + public static bool IsTypeOrArrayOfType(this object item) => item is T || item.IsArrayAndElementTypeIsT() || item.IsTArrayAndElementTypeIsItem(); + + public static T NormalizeArrayType(this object item) + { + if (item is T result) + { + return result; + } + + if (item.IsArrayAndElementTypeIsT()) + { + var array = (T[])Convert.ChangeType(item, typeof(T[])); + return array.FirstOrDefault(); + } + + if (item.IsTArrayAndElementTypeIsItem()) + { + var tType = typeof(T); + var array = Array.CreateInstance(tType.GetElementType(), 1); + array.SetValue(item, 0); + return (T)Convert.ChangeType(array, tType); + } + + return default(T); + } + + public static T GetNestedProperty(this PSObject psObject, params string[] names) => psObject.Properties.GetNestedProperty(names); + + public static T GetNestedProperty(this PSMemberInfoCollection properties, params string[] names) + { + var lastName = names.Last(); + var nestedProperties = names.Take(names.Length - 1).Aggregate(properties, (p, n) => p?.GetProperty(n)?.Properties); + return nestedProperties != null ? nestedProperties.GetProperty(lastName) : default(T); + } + + public static T GetProperty(this PSObject psObject, string name) => psObject.Properties.GetProperty(name); + + public static T GetProperty(this PSMemberInfoCollection properties, string name) + { + switch (properties[name]?.Value) + { + case PSObject psObject when psObject.BaseObject is PSCustomObject && psObject.ImmediateBaseObject.IsTypeOrArrayOfType(): + return psObject.ImmediateBaseObject.NormalizeArrayType(); + case PSObject psObject when psObject.BaseObject.IsTypeOrArrayOfType(): + return psObject.BaseObject.NormalizeArrayType(); + case object value when value.IsTypeOrArrayOfType(): + return value.NormalizeArrayType(); + default: + return default(T); + } + } + + public static IEnumerable RunScript(this PSCmdlet cmdlet, string script) + => PsHelpers.RunScript(cmdlet.InvokeCommand, script); + + public static void RunScript(this PSCmdlet cmdlet, string script) + => cmdlet.RunScript(script); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, string script) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, script); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, string script) + => engineIntrinsics.RunScript(script); + + public static IEnumerable RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => PsHelpers.RunScript(cmdlet.InvokeCommand, block.ToString()); + + public static void RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => cmdlet.RunScript(block.ToString()); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, block.ToString()); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => engineIntrinsics.RunScript(block.ToString()); + + /// + /// Returns if a parameter should be hidden by checking for . + /// + /// A PowerShell parameter. + public static bool IsHidden(this Parameter parameter) + { + return parameter.Attributes.Any(attr => attr is DoNotExportAttribute); + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/PsHelpers.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/PsHelpers.cs new file mode 100644 index 000000000000..2ca025ba44db --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/PsHelpers.cs @@ -0,0 +1,105 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using Pwsh = System.Management.Automation.PowerShell; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + internal static class PsHelpers + { + public static IEnumerable RunScript(string script) + => Pwsh.Create().AddScript(script).Invoke(); + + public static void RunScript(string script) + => RunScript(script); + + public static IEnumerable RunScript(CommandInvocationIntrinsics cii, string script) + => cii.InvokeScript(script).Select(o => o?.BaseObject).Where(o => o != null).OfType(); + + public static void RunScript(CommandInvocationIntrinsics cii, string script) + => RunScript(cii, script); + + public static IEnumerable GetModuleCmdlets(PSCmdlet cmdlet, params string[] modulePaths) + { + var getCmdletsCommand = String.Join(" + ", modulePaths.Select(mp => $"(Get-Command -Module (Import-Module '{mp}' -PassThru))")); + return (cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand)) + .Where(ci => ci.CommandType != CommandTypes.Alias); + } + + public static IEnumerable GetModuleCmdlets(params string[] modulePaths) + => GetModuleCmdlets(null, modulePaths); + + public static IEnumerable GetScriptCmdlets(PSCmdlet cmdlet, string scriptFolder) + { + // https://stackoverflow.com/a/40969712/294804 + var wrappedFolder = scriptFolder.Contains("'") ? $@"""{scriptFolder}""" : $@"'{scriptFolder}'"; + var getCmdletsCommand = $@" +$currentFunctions = Get-ChildItem function: +Get-ChildItem -Path {wrappedFolder} -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} +"; + return cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand); + } + + public static IEnumerable GetScriptCmdlets(string scriptFolder) + => GetScriptCmdlets(null, scriptFolder); + + public static IEnumerable GetScriptHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + var importModules = String.Join(Environment.NewLine, modulePaths.Select(mp => $"Import-Module '{mp}'")); + var getHelpCommand = $@" +$currentFunctions = Get-ChildItem function: +{importModules} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} | ForEach-Object {{ Get-Help -Name $_.Name -Full }} +"; + return cmdlet?.RunScript(getHelpCommand) ?? RunScript(getHelpCommand); + } + + public static IEnumerable GetScriptHelpInfo(params string[] modulePaths) + => GetScriptHelpInfo(null, modulePaths); + + public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" + )); + return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) + .Select(h => new CmdletAndHelpInfo { CommandInfo = (h["CommandInfo"] as PSObject)?.BaseObject as CommandInfo, HelpInfo = h["HelpInfo"] as PSObject }); + } + + public static IEnumerable GetModuleCmdletsAndHelpInfo(params string[] modulePaths) + => GetModuleCmdletsAndHelpInfo(null, modulePaths); + + public static CmdletAndHelpInfo ToCmdletAndHelpInfo(this CommandInfo commandInfo, PSObject helpInfo) => new CmdletAndHelpInfo { CommandInfo = commandInfo, HelpInfo = helpInfo }; + + public const string Psd1Indent = " "; + public const string GuidStart = Psd1Indent + "GUID"; + + public static Guid ReadGuidFromPsd1(string psd1Path) + { + var guid = Guid.NewGuid(); + if (File.Exists(psd1Path)) + { + var currentGuid = File.ReadAllLines(psd1Path) + .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .LastOrDefault()?.Replace("'", String.Empty); + guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; + } + + return guid; + } + } + + internal class CmdletAndHelpInfo + { + public CommandInfo CommandInfo { get; set; } + public PSObject HelpInfo { get; set; } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/StringExtensions.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/StringExtensions.cs new file mode 100644 index 000000000000..de8178232478 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/StringExtensions.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + internal static class StringExtensions + { + public static string NullIfEmpty(this string text) => String.IsNullOrEmpty(text) ? null : text; + public static string NullIfWhiteSpace(this string text) => String.IsNullOrWhiteSpace(text) ? null : text; + public static string EmptyIfNull(this string text) => text ?? String.Empty; + + public static bool? ToNullableBool(this string text) => String.IsNullOrEmpty(text) ? (bool?)null : Convert.ToBoolean(text.ToLowerInvariant()); + + public static string ToUpperFirstCharacter(this string text) => String.IsNullOrEmpty(text) ? text : $"{text[0].ToString().ToUpperInvariant()}{text.Remove(0, 1)}"; + + public static string ReplaceNewLines(this string value, string replacer = " ", string[] newLineSymbols = null) + => (newLineSymbols ?? new []{ "\r\n", "\n" }).Aggregate(value.EmptyIfNull(), (current, symbol) => current.Replace(symbol, replacer)); + public static string NormalizeNewLines(this string value) => value.ReplaceNewLines("\u00A0").Replace("\u00A0", Environment.NewLine); + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/BuildTime/XmlExtensions.cs b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/XmlExtensions.cs new file mode 100644 index 000000000000..173c3079c912 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/BuildTime/XmlExtensions.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + internal static class XmlExtensions + { + public static string ToXmlString(this T inputObject, bool excludeDeclaration = false) + { + var serializer = new XmlSerializer(typeof(T)); + //https://stackoverflow.com/a/760290/294804 + //https://stackoverflow.com/a/3732234/294804 + var namespaces = new XmlSerializerNamespaces(new[] { XmlQualifiedName.Empty }); + var xmlSettings = new XmlWriterSettings { OmitXmlDeclaration = excludeDeclaration, Indent = true }; + using (var stringWriter = new StringWriter()) + using (var xmlWriter = XmlWriter.Create(stringWriter, xmlSettings)) + { + serializer.Serialize(xmlWriter, inputObject, namespaces); + return stringWriter.ToString(); + } + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/CmdInfoHandler.cs b/swaggerci/storSimple1200Series/generated/runtime/CmdInfoHandler.cs new file mode 100644 index 000000000000..13ec86a9dea6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/CmdInfoHandler.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Management.Automation; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + using NextDelegate = Func, Task>, Task>; + using SignalDelegate = Func, Task>; + + public class CmdInfoHandler + { + private readonly string processRecordId; + private readonly string parameterSetName; + private readonly InvocationInfo invocationInfo; + + public CmdInfoHandler(string processRecordId, InvocationInfo invocationInfo, string parameterSetName) + { + this.processRecordId = processRecordId; + this.parameterSetName = parameterSetName; + this.invocationInfo = invocationInfo; + } + + public Task SendAsync(HttpRequestMessage request, CancellationToken token, Action cancel, SignalDelegate signal, NextDelegate next) + { + request.Headers.Add("x-ms-client-request-id", processRecordId); + request.Headers.Add("CommandName", invocationInfo?.InvocationName); + request.Headers.Add("FullCommandName", invocationInfo?.MyCommand?.Name); + request.Headers.Add("ParameterSetName", parameterSetName); + + // continue with pipeline. + return next(request, token, cancel, signal); + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/ConversionException.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/ConversionException.cs new file mode 100644 index 000000000000..c01f896ffa5c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/ConversionException.cs @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal class ConversionException : Exception + { + internal ConversionException(string message) + : base(message) { } + + internal ConversionException(JsonNode node, Type targetType) + : base($"Cannot convert '{node.Type}' to a {targetType.Name}") { } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/IJsonConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/IJsonConverter.cs new file mode 100644 index 000000000000..bd608c2d307b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/IJsonConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal interface IJsonConverter + { + JsonNode ToJson(object value); + + object FromJson(JsonNode node); + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/BinaryConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/BinaryConverter.cs new file mode 100644 index 000000000000..f67a28954726 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/BinaryConverter.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class BinaryConverter : JsonConverter + { + internal override JsonNode ToJson(byte[] value) => new XBinary(value); + + internal override byte[] FromJson(JsonNode node) + { + switch (node.Type) + { + case JsonType.String : return Convert.FromBase64String(node.ToString()); // Base64 Encoded + case JsonType.Binary : return ((XBinary)node).Value; + } + + throw new ConversionException(node, typeof(byte[])); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/BooleanConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/BooleanConverter.cs new file mode 100644 index 000000000000..b6df4751da49 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/BooleanConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class BooleanConverter : JsonConverter + { + internal override JsonNode ToJson(bool value) => new JsonBoolean(value); + + internal override bool FromJson(JsonNode node) => (bool)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/DateTimeConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/DateTimeConverter.cs new file mode 100644 index 000000000000..cfaeeab8a1c5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/DateTimeConverter.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class DateTimeConverter : JsonConverter + { + internal override JsonNode ToJson(DateTime value) + { + return new JsonDate(value); + } + + internal override DateTime FromJson(JsonNode node) => (DateTime)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs new file mode 100644 index 000000000000..03063cb99d07 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class DateTimeOffsetConverter : JsonConverter + { + internal override JsonNode ToJson(DateTimeOffset value) => new JsonDate(value); + + internal override DateTimeOffset FromJson(JsonNode node) => (DateTimeOffset)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/DecimalConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/DecimalConverter.cs new file mode 100644 index 000000000000..c98898792ac2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/DecimalConverter.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class DecimalConverter : JsonConverter + { + internal override JsonNode ToJson(decimal value) => new JsonNumber(value.ToString()); + + internal override decimal FromJson(JsonNode node) + { + return (decimal)node; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/DoubleConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/DoubleConverter.cs new file mode 100644 index 000000000000..d088d64d205f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/DoubleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class DoubleConverter : JsonConverter + { + internal override JsonNode ToJson(double value) => new JsonNumber(value); + + internal override double FromJson(JsonNode node) => (double)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/EnumConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/EnumConverter.cs new file mode 100644 index 000000000000..bfeb628c0a07 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/EnumConverter.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class EnumConverter : IJsonConverter + { + private readonly Type type; + + internal EnumConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + } + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + + public object FromJson(JsonNode node) + { + if (node.Type == JsonType.Number) + { + return Enum.ToObject(type, (int)node); + } + + return Enum.Parse(type, node.ToString(), ignoreCase: true); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/GuidConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/GuidConverter.cs new file mode 100644 index 000000000000..6f6847c2a5f8 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/GuidConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class GuidConverter : JsonConverter + { + internal override JsonNode ToJson(Guid value) => new JsonString(value.ToString()); + + internal override Guid FromJson(JsonNode node) => (Guid)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/HashSet'1Converter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/HashSet'1Converter.cs new file mode 100644 index 000000000000..7310b269d300 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/HashSet'1Converter.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class HashSetConverter : JsonConverter> + { + internal override JsonNode ToJson(HashSet value) + { + return new XSet(value); + } + + internal override HashSet FromJson(JsonNode node) + { + var collection = node as ICollection; + + if (collection.Count == 0) return null; + + // TODO: Remove Linq depedency + return new HashSet(collection.Cast()); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/Int16Converter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/Int16Converter.cs new file mode 100644 index 000000000000..f52a9747491f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/Int16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class Int16Converter : JsonConverter + { + internal override JsonNode ToJson(short value) => new JsonNumber(value); + + internal override short FromJson(JsonNode node) => (short)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/Int32Converter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/Int32Converter.cs new file mode 100644 index 000000000000..f5552d745a9a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/Int32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class Int32Converter : JsonConverter + { + internal override JsonNode ToJson(int value) => new JsonNumber(value); + + internal override int FromJson(JsonNode node) => (int)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/Int64Converter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/Int64Converter.cs new file mode 100644 index 000000000000..9b6d45082299 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/Int64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class Int64Converter : JsonConverter + { + internal override JsonNode ToJson(long value) => new JsonNumber(value); + + internal override long FromJson(JsonNode node) => (long)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/JsonArrayConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/JsonArrayConverter.cs new file mode 100644 index 000000000000..e20d84bcd92b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/JsonArrayConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class JsonArrayConverter : JsonConverter + { + internal override JsonNode ToJson(JsonArray value) => value; + + internal override JsonArray FromJson(JsonNode node) => (JsonArray)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/JsonObjectConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/JsonObjectConverter.cs new file mode 100644 index 000000000000..fee51dcc7ed6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/JsonObjectConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class JsonObjectConverter : JsonConverter + { + internal override JsonNode ToJson(JsonObject value) => value; + + internal override JsonObject FromJson(JsonNode node) => (JsonObject)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/SingleConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/SingleConverter.cs new file mode 100644 index 000000000000..456dc686a323 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/SingleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class SingleConverter : JsonConverter + { + internal override JsonNode ToJson(float value) => new JsonNumber(value.ToString()); + + internal override float FromJson(JsonNode node) => (float)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/StringConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/StringConverter.cs new file mode 100644 index 000000000000..ceeb5e56972d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/StringConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class StringConverter : JsonConverter + { + internal override JsonNode ToJson(string value) => new JsonString(value); + + internal override string FromJson(JsonNode node) => node.ToString(); + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/TimeSpanConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/TimeSpanConverter.cs new file mode 100644 index 000000000000..852104577a67 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/TimeSpanConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class TimeSpanConverter : JsonConverter + { + internal override JsonNode ToJson(TimeSpan value) => new JsonString(value.ToString()); + + internal override TimeSpan FromJson(JsonNode node) => (TimeSpan)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/UInt16Converter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/UInt16Converter.cs new file mode 100644 index 000000000000..fd79b7963f90 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/UInt16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class UInt16Converter : JsonConverter + { + internal override JsonNode ToJson(ushort value) => new JsonNumber(value); + + internal override ushort FromJson(JsonNode node) => (ushort)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/UInt32Converter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/UInt32Converter.cs new file mode 100644 index 000000000000..335720c92895 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/UInt32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class UInt32Converter : JsonConverter + { + internal override JsonNode ToJson(uint value) => new JsonNumber(value); + + internal override uint FromJson(JsonNode node) => (uint)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/UInt64Converter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/UInt64Converter.cs new file mode 100644 index 000000000000..eb5deed69190 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/UInt64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class UInt64Converter : JsonConverter + { + internal override JsonNode ToJson(ulong value) => new JsonNumber(value.ToString()); + + internal override ulong FromJson(JsonNode node) => (ulong)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/UriConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/UriConverter.cs new file mode 100644 index 000000000000..9278af39cf79 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/Instances/UriConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class UriConverter : JsonConverter + { + internal override JsonNode ToJson(Uri value) => new JsonString(value.AbsoluteUri); + + internal override Uri FromJson(JsonNode node) => (Uri)node; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/JsonConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/JsonConverter.cs new file mode 100644 index 000000000000..8398a6d6294e --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/JsonConverter.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public abstract class JsonConverter : IJsonConverter + { + internal abstract T FromJson(JsonNode node); + + internal abstract JsonNode ToJson(T value); + + #region IConverter + + object IJsonConverter.FromJson(JsonNode node) => FromJson(node); + + JsonNode IJsonConverter.ToJson(object value) => ToJson((T)value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/JsonConverterAttribute.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/JsonConverterAttribute.cs new file mode 100644 index 000000000000..b1cf198ef594 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/JsonConverterAttribute.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class JsonConverterAttribute : Attribute + { + internal JsonConverterAttribute(Type type) + { + Converter = (IJsonConverter)Activator.CreateInstance(type); + } + + internal IJsonConverter Converter { get; } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/JsonConverterFactory.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/JsonConverterFactory.cs new file mode 100644 index 000000000000..0e7141959452 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/JsonConverterFactory.cs @@ -0,0 +1,91 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class JsonConverterFactory + { + private static readonly Dictionary converters = new Dictionary(); + + static JsonConverterFactory() + { + AddInternal(new BooleanConverter()); + AddInternal(new DateTimeConverter()); + AddInternal(new DateTimeOffsetConverter()); + AddInternal(new BinaryConverter()); + AddInternal(new DecimalConverter()); + AddInternal(new DoubleConverter()); + AddInternal(new GuidConverter()); + AddInternal(new Int16Converter()); + AddInternal(new Int32Converter()); + AddInternal(new Int64Converter()); + AddInternal(new SingleConverter()); + AddInternal(new StringConverter()); + AddInternal(new TimeSpanConverter()); + AddInternal(new UInt16Converter()); + AddInternal(new UInt32Converter()); + AddInternal(new UInt64Converter()); + AddInternal(new UriConverter()); + + // Hash sets + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + + // JSON + + AddInternal(new JsonObjectConverter()); + AddInternal(new JsonArrayConverter()); + } + + internal static Dictionary Instances => converters; + + internal static IJsonConverter Get(Type type) + { + var details = TypeDetails.Get(type); + + if (details.JsonConverter == null) + { + throw new ConversionException($"No converter found for '{type.Name}'."); + } + + return details.JsonConverter; + } + + internal static bool TryGet(Type type, out IJsonConverter converter) + { + var typeDetails = TypeDetails.Get(type); + + converter = typeDetails.JsonConverter; + + return converter != null; + } + + private static void AddInternal(JsonConverter converter) + => converters.Add(typeof(T), converter); + + private static void AddInternal(IJsonConverter converter) + => converters.Add(typeof(T), converter); + + internal static void Add(JsonConverter converter) + { + if (converter == null) + { + throw new ArgumentNullException(nameof(converter)); + } + + AddInternal(converter); + + var type = TypeDetails.Get(); + + type.JsonConverter = converter; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Conversions/StringLikeConverter.cs b/swaggerci/storSimple1200Series/generated/runtime/Conversions/StringLikeConverter.cs new file mode 100644 index 000000000000..c8e848df6453 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Conversions/StringLikeConverter.cs @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class StringLikeConverter : IJsonConverter + { + private readonly Type type; + private readonly MethodInfo parseMethod; + + internal StringLikeConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + this.parseMethod = StringLikeHelper.GetParseMethod(type); + } + + public object FromJson(JsonNode node) => + parseMethod.Invoke(null, new[] { node.ToString() }); + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + } + + internal static class StringLikeHelper + { + private static readonly Type[] parseMethodParamaterTypes = new[] { typeof(string) }; + + internal static bool IsStringLike(Type type) + { + return GetParseMethod(type) != null; + } + + internal static MethodInfo GetParseMethod(Type type) + { + MethodInfo method = type.GetMethod("Parse", parseMethodParamaterTypes); + + if (method?.IsPublic != true) return null; + + return method; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Customizations/IJsonSerializable.cs b/swaggerci/storSimple1200Series/generated/runtime/Customizations/IJsonSerializable.cs new file mode 100644 index 000000000000..fdd8bc9a6567 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Customizations/IJsonSerializable.cs @@ -0,0 +1,263 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json; +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + public interface IJsonSerializable + { + JsonNode ToJson(JsonObject container = null, SerializationMode serializationMode = SerializationMode.None); + } + internal static class JsonSerializable + { + /// + /// Serializes an enumerable and returns a JsonNode. + /// + /// an IEnumerable collection of items + /// A JsonNode that contains the collection of items serialized. + private static JsonNode ToJsonValue(System.Collections.IEnumerable enumerable) + { + if (enumerable != null) + { + // is it a byte array of some kind? + if (enumerable is System.Collections.Generic.IEnumerable byteEnumerable) + { + return new XBinary(System.Linq.Enumerable.ToArray(byteEnumerable)); + } + + var hasValues = false; + // just create an array of value nodes. + var result = new XNodeArray(); + foreach (var each in enumerable) + { + // we had at least one value. + hasValues = true; + + // try to serialize it. + var node = ToJsonValue(each); + if (null != node) + { + result.Add(node); + } + } + + // if we were able to add values, (or it was just empty), return it. + if (result.Count > 0 || !hasValues) + { + return result; + } + } + + // we couldn't serialize the values. Sorry. + return null; + } + + /// + /// Serializes a valuetype to a JsonNode. + /// + /// a ValueType (ie, a primitive, enum or struct) to be serialized + /// a JsonNode with the serialized value + private static JsonNode ToJsonValue(ValueType vValue) + { + // numeric type + if (vValue is SByte || vValue is Int16 || vValue is Int32 || vValue is Int64 || vValue is Byte || vValue is UInt16 || vValue is UInt32 || vValue is UInt64 || vValue is decimal || vValue is float || vValue is double) + { + return new JsonNumber(vValue.ToString()); + } + + // boolean type + if (vValue is bool bValue) + { + return new JsonBoolean(bValue); + } + + // dates + if (vValue is DateTime dtValue) + { + return new JsonDate(dtValue); + } + + // DictionaryEntity struct type + if (vValue is System.Collections.DictionaryEntry deValue) + { + return new JsonObject { { deValue.Key.ToString(), ToJsonValue(deValue.Value) } }; + } + + // sorry, no idea. + return null; + } + /// + /// Attempts to serialize an object by using ToJson() or ToJsonString() if they exist. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + private static JsonNode TryToJsonValue(dynamic oValue) + { + object jsonValue = null; + dynamic v = oValue; + try + { + jsonValue = v.ToJson().ToString(); + } + catch + { + // no harm... + try + { + jsonValue = v.ToJsonString().ToString(); + } + catch + { + // no worries here either. + } + } + + // if we got something out, let's use it. + if (null != jsonValue) + { + // JsonNumber is really a literal json value. Just don't try to cast that back to an actual number, ok? + return new JsonNumber(jsonValue.ToString()); + } + + return null; + } + + /// + /// Serialize an object by using a variety of methods. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + internal static JsonNode ToJsonValue(object value) + { + // things that implement our interface are preferred. + if (value is Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IJsonSerializable jsonSerializable) + { + return jsonSerializable.ToJson(); + } + + // strings are easy. + if (value is string || value is char) + { + return new JsonString(value.ToString()); + } + + // value types are fairly straightforward (fallback to ToJson()/ToJsonString() or literal JsonString ) + if (value is System.ValueType vValue) + { + return ToJsonValue(vValue) ?? TryToJsonValue(vValue) ?? new JsonString(vValue.ToString()); + } + + // dictionaries are objects that should be able to serialize + if (value is System.Collections.Generic.IDictionary dictionary) + { + return Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.JsonSerializable.ToJson(dictionary, null); + } + + // hashtables are converted to dictionaries for serialization + if (value is System.Collections.Hashtable hashtable) + { + var dict = new System.Collections.Generic.Dictionary(); + DictionaryExtensions.HashTableToDictionary(hashtable, dict); + return Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.JsonSerializable.ToJson(dict, null); + } + + // enumerable collections are handled like arrays (again, fallback to ToJson()/ToJsonString() or literal JsonString) + if (value is System.Collections.IEnumerable enumerableValue) + { + // some kind of enumerable value + return ToJsonValue(enumerableValue) ?? TryToJsonValue(value) ?? new JsonString(value.ToString()); + } + + // at this point, we're going to fallback to a string literal here, since we really have no idea what it is. + return new JsonString(value.ToString()); + } + + internal static JsonObject ToJson(System.Collections.Generic.Dictionary dictionary, JsonObject container) => ToJson((System.Collections.Generic.IDictionary)dictionary, container); + + /// + /// Serializes a dictionary into a JsonObject container. + /// + /// The dictionary to serailize + /// the container to serialize the dictionary into + /// the container + internal static JsonObject ToJson(System.Collections.Generic.IDictionary dictionary, JsonObject container) + { + container = container ?? new JsonObject(); + if (dictionary != null && dictionary.Count > 0) + { + foreach (var key in dictionary) + { + // currently, we don't serialize null values. + if (null != key.Value) + { + container.Add(key.Key, ToJsonValue(key.Value)); + continue; + } + } + } + return container; + } + + internal static Func> DeserializeDictionary(Func> dictionaryFactory) + { + return (node) => FromJson(node, dictionaryFactory(), (object)(DeserializeDictionary(dictionaryFactory)) as Func); + } + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.Dictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) => FromJson(json, (System.Collections.Generic.IDictionary)container, objectFactory, excludes); + + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.IDictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) + { + if (null == json) + { + return container; + } + + foreach (var key in json.Keys) + { + if (true == excludes?.Contains(key)) + { + continue; + } + + var value = json[key]; + try + { + switch (value.Type) + { + case JsonType.Null: + // skip null values. + continue; + + case JsonType.Array: + case JsonType.Boolean: + case JsonType.Date: + case JsonType.Binary: + case JsonType.Number: + case JsonType.String: + container.Add(key, (V)value.ToValue()); + break; + case JsonType.Object: + if (objectFactory != null) + { + var v = objectFactory(value as JsonObject); + if (null != v) + { + container.Add(key, v); + } + } + break; + } + } + catch + { + } + } + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonArray.cs b/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonArray.cs new file mode 100644 index 000000000000..d38c50082d60 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonArray.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public partial class JsonArray + { + internal override object ToValue() => Count == 0 ? new object[0] : System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(this, each => each.ToValue())); + } + + +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonBoolean.cs b/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonBoolean.cs new file mode 100644 index 000000000000..5b2f3216f854 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonBoolean.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal partial class JsonBoolean + { + internal static JsonBoolean Create(bool? value) => value is bool b ? new JsonBoolean(b) : null; + internal bool ToBoolean() => Value; + + internal override object ToValue() => Value; + } + + +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonNode.cs b/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonNode.cs new file mode 100644 index 000000000000..e8262316ef5a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonNode.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonNode + { + /// + /// Returns the content of this node as the underlying value. + /// Will default to the string representation if not overridden in child classes. + /// + /// an object with the underlying value of the node. + internal virtual object ToValue() { + return this.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonNumber.cs b/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonNumber.cs new file mode 100644 index 000000000000..9c8f3c5987de --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonNumber.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + using System; + + public partial class JsonNumber + { + internal static readonly DateTime EpochDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + private static long ToUnixTime(DateTime dateTime) + { + return (long)dateTime.Subtract(EpochDate).TotalSeconds; + } + private static DateTime FromUnixTime(long totalSeconds) + { + return EpochDate.AddSeconds(totalSeconds); + } + internal byte ToByte() => this; + internal int ToInt() => this; + internal long ToLong() => this; + internal short ToShort() => this; + internal UInt16 ToUInt16() => this; + internal UInt32 ToUInt32() => this; + internal UInt64 ToUInt64() => this; + internal decimal ToDecimal() => this; + internal double ToDouble() => this; + internal float ToFloat() => this; + + internal static JsonNumber Create(int? value) => value is int n ? new JsonNumber(n) : null; + internal static JsonNumber Create(long? value) => value is long n ? new JsonNumber(n) : null; + internal static JsonNumber Create(float? value) => value is float n ? new JsonNumber(n) : null; + internal static JsonNumber Create(double? value) => value is double n ? new JsonNumber(n) : null; + internal static JsonNumber Create(decimal? value) => value is decimal n ? new JsonNumber(n) : null; + internal static JsonNumber Create(DateTime? value) => value is DateTime date ? new JsonNumber(ToUnixTime(date)) : null; + + public static implicit operator DateTime(JsonNumber number) => FromUnixTime(number); + internal DateTime ToDateTime() => this; + + internal JsonNumber(decimal value) + { + this.value = value.ToString(); + } + internal override object ToValue() + { + if (IsInteger) + { + if (int.TryParse(this.value, out int iValue)) + { + return iValue; + } + if (long.TryParse(this.value, out long lValue)) + { + return lValue; + } + } + else + { + if (float.TryParse(this.value, out float fValue)) + { + return fValue; + } + if (double.TryParse(this.value, out double dValue)) + { + return dValue; + } + if (decimal.TryParse(this.value, out decimal dcValue)) + { + return dcValue; + } + } + return null; + } + } + + +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonObject.cs b/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonObject.cs new file mode 100644 index 000000000000..a3310498448a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonObject.cs @@ -0,0 +1,183 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonObject + { + internal override object ToValue() => Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.JsonSerializable.FromJson(this, new System.Collections.Generic.Dictionary(), (obj) => obj.ToValue()); + + internal void SafeAdd(string name, Func valueFn) + { + if (valueFn != null) + { + var value = valueFn(); + if (null != value) + { + items.Add(name, value); + } + } + } + + internal void SafeAdd(string name, JsonNode value) + { + if (null != value) + { + items.Add(name, value); + } + } + + internal T NullableProperty(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; + } + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + //throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal JsonObject Property(string propertyName) + { + return PropertyT(propertyName); + } + + internal T PropertyT(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; // we're going to assume that the consumer knows what to do if null is explicity returned? + } + + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + // throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal int NumberProperty(string propertyName, ref int output) => output = this.PropertyT(propertyName)?.ToInt() ?? output; + internal float NumberProperty(string propertyName, ref float output) => output = this.PropertyT(propertyName)?.ToFloat() ?? output; + internal byte NumberProperty(string propertyName, ref byte output) => output = this.PropertyT(propertyName)?.ToByte() ?? output; + internal long NumberProperty(string propertyName, ref long output) => output = this.PropertyT(propertyName)?.ToLong() ?? output; + internal double NumberProperty(string propertyName, ref double output) => output = this.PropertyT(propertyName)?.ToDouble() ?? output; + internal decimal NumberProperty(string propertyName, ref decimal output) => output = this.PropertyT(propertyName)?.ToDecimal() ?? output; + internal short NumberProperty(string propertyName, ref short output) => output = this.PropertyT(propertyName)?.ToShort() ?? output; + internal DateTime NumberProperty(string propertyName, ref DateTime output) => output = this.PropertyT(propertyName)?.ToDateTime() ?? output; + + internal int? NumberProperty(string propertyName, ref int? output) => output = this.NullableProperty(propertyName)?.ToInt() ?? null; + internal float? NumberProperty(string propertyName, ref float? output) => output = this.NullableProperty(propertyName)?.ToFloat() ?? null; + internal byte? NumberProperty(string propertyName, ref byte? output) => output = this.NullableProperty(propertyName)?.ToByte() ?? null; + internal long? NumberProperty(string propertyName, ref long? output) => output = this.NullableProperty(propertyName)?.ToLong() ?? null; + internal double? NumberProperty(string propertyName, ref double? output) => output = this.NullableProperty(propertyName)?.ToDouble() ?? null; + internal decimal? NumberProperty(string propertyName, ref decimal? output) => output = this.NullableProperty(propertyName)?.ToDecimal() ?? null; + internal short? NumberProperty(string propertyName, ref short? output) => output = this.NullableProperty(propertyName)?.ToShort() ?? null; + + internal DateTime? NumberProperty(string propertyName, ref DateTime? output) => output = this.NullableProperty(propertyName)?.ToDateTime() ?? null; + + + internal string StringProperty(string propertyName) => this.PropertyT(propertyName)?.ToString(); + internal string StringProperty(string propertyName, ref string output) => output = this.PropertyT(propertyName)?.ToString() ?? output; + internal char StringProperty(string propertyName, ref char output) => output = this.PropertyT(propertyName)?.ToChar() ?? output; + internal char? StringProperty(string propertyName, ref char? output) => output = this.PropertyT(propertyName)?.ToChar() ?? null; + + internal DateTime StringProperty(string propertyName, ref DateTime output) => DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out output) ? output : output; + internal DateTime? StringProperty(string propertyName, ref DateTime? output) => output = DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out var o) ? o : output; + + + internal bool BooleanProperty(string propertyName, ref bool output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? output; + internal bool? BooleanProperty(string propertyName, ref bool? output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? null; + + internal T[] ArrayProperty(string propertyName, ref T[] output, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + } + return output; + } + internal T[] ArrayProperty(string propertyName, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + var output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + return output; + } + return new T[0]; + } + internal void IterateArrayProperty(string propertyName, Action deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + for (var i = 0; i < array.Count; i++) + { + deserializer(array[i]); + } + } + } + + internal Dictionary DictionaryProperty(string propertyName, ref Dictionary output, Func deserializer) + { + var dictionary = this.PropertyT(propertyName); + if (output == null) + { + output = new Dictionary(); + } + else + { + output.Clear(); + } + if (dictionary != null) + { + foreach (var key in dictionary.Keys) + { + output[key] = deserializer(dictionary[key]); + } + } + return output; + } + + internal static JsonObject Create(IDictionary source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new JsonObject(); + + foreach (var key in source.Keys) + { + result.SafeAdd(key, selector(source[key])); + } + return result; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonString.cs b/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonString.cs new file mode 100644 index 000000000000..1d2a3bb0e69c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Customizations/JsonString.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + using System; + using System.Globalization; + using System.Linq; + + public partial class JsonString + { + internal static string DateFormat = "yyyy-MM-dd"; + internal static string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"; + internal static string DateTimeRfc1123Format = "R"; + + internal static JsonString Create(string value) => value == null ? null : new JsonString(value); + internal static JsonString Create(char? value) => value is char c ? new JsonString(c.ToString()) : null; + + internal static JsonString CreateDate(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTime(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTimeRfc1123(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeRfc1123Format, CultureInfo.CurrentCulture)) : null; + + internal char ToChar() => this.Value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char(JsonString value) => value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char? (JsonString value) => value?.ToString()?.FirstOrDefault(); + + public static implicit operator DateTime(JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime); + public static implicit operator DateTime? (JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime?); + + } + + +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Customizations/XNodeArray.cs b/swaggerci/storSimple1200Series/generated/runtime/Customizations/XNodeArray.cs new file mode 100644 index 000000000000..d28a0a374561 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Customizations/XNodeArray.cs @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + using System; + using System.Linq; + + public partial class XNodeArray + { + internal static XNodeArray Create(T[] source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new XNodeArray(); + foreach (var item in source.Select(selector)) + { + result.SafeAdd(item); + } + return result; + } + internal void SafeAdd(JsonNode item) + { + if (item != null) + { + items.Add(item); + } + } + internal void SafeAdd(Func itemFn) + { + if (itemFn != null) + { + var item = itemFn(); + if (item != null) + { + items.Add(item); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Debugging.cs b/swaggerci/storSimple1200Series/generated/runtime/Debugging.cs new file mode 100644 index 000000000000..cdd8ae16580d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Debugging.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + internal static class AttachDebugger + { + internal static void Break() + { + while (!System.Diagnostics.Debugger.IsAttached) + { + System.Console.Error.WriteLine($"Waiting for debugger to attach to process {System.Diagnostics.Process.GetCurrentProcess().Id}"); + for (int i = 0; i < 50; i++) + { + if (System.Diagnostics.Debugger.IsAttached) + { + break; + } + System.Threading.Thread.Sleep(100); + System.Console.Error.Write("."); + } + System.Console.Error.WriteLine(); + } + System.Diagnostics.Debugger.Break(); + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/DictionaryExtensions.cs b/swaggerci/storSimple1200Series/generated/runtime/DictionaryExtensions.cs new file mode 100644 index 000000000000..7b2715c36530 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/DictionaryExtensions.cs @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + internal static class DictionaryExtensions + { + internal static void HashTableToDictionary(System.Collections.Hashtable hashtable, System.Collections.Generic.IDictionary dictionary) + { + if (null == hashtable) + { + return; + } + foreach (var each in hashtable.Keys) + { + var key = each.ToString(); + var value = hashtable[key]; + if (null != value) + { + try + { + dictionary[key] = (V)value; + } + catch + { + // Values getting dropped; not compatible with target dictionary. Not sure what to do here. + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/EventData.cs b/swaggerci/storSimple1200Series/generated/runtime/EventData.cs new file mode 100644 index 000000000000..ad905d0bf93b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/EventData.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + + using System; + using System.Threading; + + ///Represents the data in signaled event. + public partial class EventData + { + /// + /// The type of the event being signaled + /// + public string Id; + + /// + /// The user-ready message from the event. + /// + public string Message; + + /// + /// When the event is about a parameter, this is the parameter name. + /// Used in Validation Events + /// + public string Parameter; + + /// + /// This represents a numeric value associated with the event. + /// Use for progress-style events + /// + public double Value; + + /// + /// Any extended data for an event should be serialized and stored here. + /// + public string ExtendedData; + + /// + /// If the event triggers after the request message has been created, this will contain the Request Message (which in HTTP calls would be HttpRequestMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.RequestMessgae is HttpRequestMessage httpRequest) + /// { + /// httpRequest.Headers.Add("x-request-flavor", "vanilla"); + /// } + /// + /// + public object RequestMessage; + + /// + /// If the event triggers after the response is back, this will contain the Response Message (which in HTTP calls would be HttpResponseMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.ResponseMessage is HttpResponseMessage httpResponse){ + /// var flavor = httpResponse.Headers.GetValue("x-request-flavor"); + /// } + /// + /// + public object ResponseMessage; + + /// + /// Cancellation method for this event. + /// + /// If the event consumer wishes to cancel the request that initiated this event, call Cancel() + /// + /// + /// The original initiator of the request must provide the implementation of this. + /// + public System.Action Cancel; + } + +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/EventDataExtensions.cs b/swaggerci/storSimple1200Series/generated/runtime/EventDataExtensions.cs new file mode 100644 index 000000000000..819ba52486be --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/EventDataExtensions.cs @@ -0,0 +1,94 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + using System; + + /// + /// PowerShell-specific data on top of the llc# EventData + /// + /// + /// In PowerShell, we add on the EventDataConverter to support sending events between modules. + /// Obviously, this code would need to be duplcated on both modules. + /// This is preferable to sharing a common library, as versioning makes that problematic. + /// + [System.ComponentModel.TypeConverter(typeof(EventDataConverter))] + public partial class EventData : EventArgs + { + } + + /// + /// A PowerShell PSTypeConverter to adapt an EventData object that has been passed. + /// Usually used between modules. + /// + public class EventDataConverter : System.Management.Automation.PSTypeConverter + { + public override bool CanConvertTo(object sourceValue, Type destinationType) => false; + public override object ConvertTo(object sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => null; + public override bool CanConvertFrom(dynamic sourceValue, Type destinationType) => destinationType == typeof(EventData) && CanConvertFrom(sourceValue); + public override object ConvertFrom(dynamic sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Verifies that a given object has the required members to convert it to the target type (EventData) + /// + /// Uses a dynamic type so that it is able to use the simplest code without excessive checking. + /// + /// The instance to verify + /// True, if the object has all the required parameters. + public static bool CanConvertFrom(dynamic sourceValue) + { + try + { + // check if this has *required* parameters... + sourceValue?.Id?.GetType(); + sourceValue?.Message?.GetType(); + sourceValue?.Cancel?.GetType(); + + // remaining parameters are not *required*, + // and if they have values, it will copy them at conversion time. + } + catch + { + // if anything throws an exception (because it's null, or doesn't have that member) + return false; + } + return true; + } + + /// + /// Returns result of the delegate as the expected type, or default(T) + /// + /// This isolates any exceptions from the consumer. + /// + /// A delegate that returns a value + /// The desired output type + /// The value from the function if the type is correct + private static T To(Func srcValue) + { + try { return srcValue(); } + catch { return default(T); } + } + + /// + /// Converts an incoming object to the expected type by treating the incoming object as a dynamic, and coping the expected values. + /// + /// the incoming object + /// EventData + public static EventData ConvertFrom(dynamic sourceValue) + { + return new EventData + { + Id = To(() => sourceValue.Id), + Message = To(() => sourceValue.Message), + Parameter = To(() => sourceValue.Parameter), + Value = To(() => sourceValue.Value), + RequestMessage = To(() => sourceValue.RequestMessage), + ResponseMessage = To(() => sourceValue.ResponseMessage), + Cancel = To(() => sourceValue.Cancel) + }; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/EventListener.cs b/swaggerci/storSimple1200Series/generated/runtime/EventListener.cs new file mode 100644 index 000000000000..6da09b2e2618 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/EventListener.cs @@ -0,0 +1,247 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + + using System; + using System.Linq; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData = System.Func; + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + public interface IValidates + { + Task Validate(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IEventListener listener); + } + + /// + /// The IEventListener Interface defines the communication mechanism for Signaling events during a remote call. + /// + /// + /// The interface is designed to be as minimal as possible, allow for quick peeking of the event type (id) + /// and the cancellation status and provides a delegate for retrieving the event details themselves. + /// + public interface IEventListener + { + Task Signal(string id, CancellationToken token, GetEventData createMessage); + CancellationToken Token { get; } + System.Action Cancel { get; } + } + + internal static partial class Extensions + { + public static Task Signal(this IEventListener instance, string id, CancellationToken token, Func createMessage) => instance.Signal(id, token, createMessage); + public static Task Signal(this IEventListener instance, string id, CancellationToken token) => instance.Signal(id, token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, EventData message) => instance.Signal(id, token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, Func createMessage) => instance.Signal(id, instance.Token, createMessage); + public static Task Signal(this IEventListener instance, string id) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, EventData message) => instance.Signal(id, instance.Token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, System.Uri uri) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = uri.ToString(), Cancel = instance.Cancel }); + + public static async Task AssertNotNull(this IEventListener instance, string parameterName, object value) + { + if (value == null) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' should not be null", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMinimumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length < length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is less than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMaximumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length > length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is greater than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + + public static async Task AssertRegEx(this IEventListener instance, string parameterName, string value, string regularExpression) + { + if (value != null && !System.Text.RegularExpressions.Regex.Match(value, regularExpression).Success) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' does not validate against pattern /{regularExpression}/", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertEnum(this IEventListener instance, string parameterName, string value, params string[] values) + { + if (!values.Any(each => each.Equals(value))) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' is not one of ({values.Aggregate((c, e) => $"'{e}',{c}")}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertObjectIsValid(this IEventListener instance, string parameterName, object inst) + { + await (inst as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.IValidates)?.Validate(instance); + } + + public static async Task AssertIsLessThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) >= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) <= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsLessThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) > 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) < 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, Int64? value, Int64 multiple) + { + if (null != value && value % multiple != 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, double? value, double multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, decimal? value, decimal multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + } + + /// + /// An Implementation of the IEventListener that supports subscribing to events and dispatching them + /// (used for manually using the lowlevel interface) + /// + public class EventListener : CancellationTokenSource, IEnumerable>, IEventListener + { + private Dictionary calls = new Dictionary(); + public IEnumerator> GetEnumerator() => calls.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => calls.GetEnumerator(); + public EventListener() + { + } + + public new Action Cancel => base.Cancel; + private Event tracer; + + public EventListener(params (string name, Event callback)[] initializer) + { + foreach (var each in initializer) + { + Add(each.name, each.callback); + } + } + + public void Add(string name, SynchEvent callback) + { + Add(name, (message) => { callback(message); return Task.CompletedTask; }); + } + + public void Add(string name, Event callback) + { + if (callback != null) + { + if (string.IsNullOrEmpty(name)) + { + if (calls.ContainsKey(name)) + { + tracer += callback; + } + else + { + tracer = callback; + } + } + else + { + if (calls.ContainsKey(name)) + { + calls[name ?? System.String.Empty] += callback; + } + else + { + calls[name ?? System.String.Empty] = callback; + } + } + } + } + + + public async Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + using (NoSynchronizationContext) + { + if (!string.IsNullOrEmpty(id) && (calls.TryGetValue(id, out Event listener) || tracer != null)) + { + var message = createMessage(); + message.Id = id; + + await listener?.Invoke(message); + await tracer?.Invoke(message); + + if (token.IsCancellationRequested) + { + throw new OperationCanceledException($"Canceled by event {id} ", this.Token); + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Events.cs b/swaggerci/storSimple1200Series/generated/runtime/Events.cs new file mode 100644 index 000000000000..03daed2553ff --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Events.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + public static partial class Events + { + public const string Log = nameof(Log); + public const string Validation = nameof(Validation); + public const string ValidationWarning = nameof(ValidationWarning); + public const string AfterValidation = nameof(AfterValidation); + public const string RequestCreated = nameof(RequestCreated); + public const string ResponseCreated = nameof(ResponseCreated); + public const string URLCreated = nameof(URLCreated); + public const string Finally = nameof(Finally); + public const string HeaderParametersAdded = nameof(HeaderParametersAdded); + public const string BodyContentSet = nameof(BodyContentSet); + public const string BeforeCall = nameof(BeforeCall); + public const string BeforeResponseDispatch = nameof(BeforeResponseDispatch); + public const string FollowingNextLink = nameof(FollowingNextLink); + public const string DelayBeforePolling = nameof(DelayBeforePolling); + public const string Polling = nameof(Polling); + + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/EventsExtensions.cs b/swaggerci/storSimple1200Series/generated/runtime/EventsExtensions.cs new file mode 100644 index 000000000000..fbcb3f76b38f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/EventsExtensions.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + public static partial class Events + { + public const string CmdletProcessRecordStart = nameof(CmdletProcessRecordStart); + public const string CmdletProcessRecordAsyncStart = nameof(CmdletProcessRecordAsyncStart); + public const string CmdletException = nameof(CmdletException); + public const string CmdletGetPipeline = nameof(CmdletGetPipeline); + public const string CmdletBeforeAPICall = nameof(CmdletBeforeAPICall); + public const string CmdletBeginProcessing = nameof(CmdletBeginProcessing); + public const string CmdletEndProcessing = nameof(CmdletEndProcessing); + public const string CmdletProcessRecordEnd = nameof(CmdletProcessRecordEnd); + public const string CmdletProcessRecordAsyncEnd = nameof(CmdletProcessRecordAsyncEnd); + public const string CmdletAfterAPICall = nameof(CmdletAfterAPICall); + + public const string Verbose = nameof(Verbose); + public const string Debug = nameof(Debug); + public const string Information = nameof(Information); + public const string Error = nameof(Error); + public const string Warning = nameof(Warning); + } + +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Extensions.cs b/swaggerci/storSimple1200Series/generated/runtime/Extensions.cs new file mode 100644 index 000000000000..1bdc4284c537 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Extensions.cs @@ -0,0 +1,117 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + using System.Linq; + using System; + + internal static partial class Extensions + { + public static T[] SubArray(this T[] array, int offset, int length) + { + return new ArraySegment(array, offset, length) + .ToArray(); + } + + public static T ReadHeaders(this T instance, global::System.Net.Http.Headers.HttpResponseHeaders headers) where T : class + { + (instance as IHeaderSerializable)?.ReadHeaders(headers); + return instance; + } + + internal static bool If(T input, out T output) + { + if (null == input) + { + output = default(T); + return false; + } + output = input; + return true; + } + + internal static void AddIf(T value, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(value); + } + } + + internal static void AddIf(T value, string serializedName, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(serializedName, value); + } + } + + /// + /// Returns the first header value as a string from an HttpReponseMessage. + /// + /// the HttpResponseMessage to fetch a header from + /// the header name + /// the first header value as a string from an HttpReponseMessage. string.empty if there is no header value matching + internal static string GetFirstHeader(this System.Net.Http.HttpResponseMessage response, string headerName) => response.Headers.FirstOrDefault(each => string.Equals(headerName, each.Key, System.StringComparison.OrdinalIgnoreCase)).Value?.FirstOrDefault() ?? string.Empty; + + /// + /// Sets the Synchronization Context to null, and returns an IDisposable that when disposed, + /// will restore the synchonization context to the original value. + /// + /// This is used a less-invasive means to ensure that code in the library that doesn't + /// need to be continued in the original context doesn't have to have ConfigureAwait(false) + /// on every single await + /// + /// If the SynchronizationContext is null when this is used, the resulting IDisposable + /// will not do anything (this prevents excessive re-setting of the SynchronizationContext) + /// + /// Usage: + /// + /// using(NoSynchronizationContext) { + /// await SomeAsyncOperation(); + /// await SomeOtherOperation(); + /// } + /// + /// + /// + /// An IDisposable that will return the SynchronizationContext to original state + internal static System.IDisposable NoSynchronizationContext => System.Threading.SynchronizationContext.Current == null ? Dummy : new NoSyncContext(); + + /// + /// An instance of the Dummy IDispoable. + /// + /// + internal static System.IDisposable Dummy = new DummyDisposable(); + + /// + /// An IDisposable that does absolutely nothing. + /// + internal class DummyDisposable : System.IDisposable + { + public void Dispose() + { + } + } + /// + /// An IDisposable that saves the SynchronizationContext,sets it to null and + /// restores it to the original upon Dispose(). + /// + /// NOTE: This is designed to be less invasive than using .ConfigureAwait(false) + /// on every single await in library code (ie, places where we know we don't need + /// to continue in the same context as we went async) + /// + internal class NoSyncContext : System.IDisposable + { + private System.Threading.SynchronizationContext original = System.Threading.SynchronizationContext.Current; + internal NoSyncContext() + { + System.Threading.SynchronizationContext.SetSynchronizationContext(null); + } + public void Dispose() => System.Threading.SynchronizationContext.SetSynchronizationContext(original); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs b/swaggerci/storSimple1200Series/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs new file mode 100644 index 000000000000..a9985d898975 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal static class StringBuilderExtensions + { + /// + /// Extracts the buffered value and resets the buffer + /// + internal static string Extract(this StringBuilder builder) + { + var text = builder.ToString(); + + builder.Clear(); + + return text; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Helpers/Extensions/TypeExtensions.cs b/swaggerci/storSimple1200Series/generated/runtime/Helpers/Extensions/TypeExtensions.cs new file mode 100644 index 000000000000..90d213b6bba7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Helpers/Extensions/TypeExtensions.cs @@ -0,0 +1,61 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal static class TypeExtensions + { + internal static bool IsNullable(this Type type) => + type.IsGenericType && type.GetGenericTypeDefinition().Equals(typeof(Nullable<>)); + + internal static Type GetOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition() == openGenericInterfaceType) + { + return candidateType; + } + + // Check if it references it's own converter.... + + foreach (Type interfaceType in candidateType.GetInterfaces()) + { + if (interfaceType.IsGenericType + && interfaceType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return interfaceType; + } + } + + return null; + } + + // Author: Sebastian Good + // http://stackoverflow.com/questions/503263/how-to-determine-if-a-type-implements-a-specific-generic-interface-type + internal static bool ImplementsOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + if (candidateType.Equals(openGenericInterfaceType)) + { + return true; + } + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return true; + } + + foreach (Type i in candidateType.GetInterfaces()) + { + if (i.IsGenericType && i.ImplementsOpenGenericInterface(openGenericInterfaceType)) + { + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Helpers/Seperator.cs b/swaggerci/storSimple1200Series/generated/runtime/Helpers/Seperator.cs new file mode 100644 index 000000000000..3217824c8486 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Helpers/Seperator.cs @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal static class Seperator + { + internal static readonly char[] Dash = { '-' }; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Helpers/TypeDetails.cs b/swaggerci/storSimple1200Series/generated/runtime/Helpers/TypeDetails.cs new file mode 100644 index 000000000000..14d038018ee5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Helpers/TypeDetails.cs @@ -0,0 +1,116 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + + + + internal class TypeDetails + { + private readonly Type info; + + internal TypeDetails(Type info) + { + this.info = info ?? throw new ArgumentNullException(nameof(info)); + } + + internal Type NonNullType { get; set; } + + internal object DefaultValue { get; set; } + + internal bool IsNullable { get; set; } + + internal bool IsList { get; set; } + + internal bool IsStringLike { get; set; } + + internal bool IsEnum => info.IsEnum; + + internal bool IsArray => info.IsArray; + + internal bool IsValueType => info.IsValueType; + + internal Type ElementType { get; set; } + + internal IJsonConverter JsonConverter { get; set; } + + #region Creation + + private static readonly ConcurrentDictionary cache = new ConcurrentDictionary(); + + internal static TypeDetails Get() => Get(typeof(T)); + + internal static TypeDetails Get(Type type) => cache.GetOrAdd(type, Create); + + private static TypeDetails Create(Type type) + { + var isGenericList = !type.IsPrimitive && type.ImplementsOpenGenericInterface(typeof(IList<>)); + var isList = !type.IsPrimitive && (isGenericList || typeof(IList).IsAssignableFrom(type)); + + var isNullable = type.IsNullable(); + + Type elementType; + + if (type.IsArray) + { + elementType = type.GetElementType(); + } + else if (isGenericList) + { + var iList = type.GetOpenGenericInterface(typeof(IList<>)); + + elementType = iList.GetGenericArguments()[0]; + } + else + { + elementType = null; + } + + var nonNullType = isNullable ? type.GetGenericArguments()[0] : type; + + var isStringLike = false; + + IJsonConverter converter; + + var jsonConverterAttribute = type.GetCustomAttribute(); + + if (jsonConverterAttribute != null) + { + converter = jsonConverterAttribute.Converter; + } + else if (nonNullType.IsEnum) + { + converter = new EnumConverter(nonNullType); + } + else if (JsonConverterFactory.Instances.TryGetValue(nonNullType, out converter)) + { + } + else if (StringLikeHelper.IsStringLike(nonNullType)) + { + isStringLike = true; + + converter = new StringLikeConverter(nonNullType); + } + + return new TypeDetails(nonNullType) { + NonNullType = nonNullType, + DefaultValue = type.IsValueType ? Activator.CreateInstance(type) : null, + IsNullable = isNullable, + IsList = isList, + IsStringLike = isStringLike, + ElementType = elementType, + JsonConverter = converter + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Helpers/XHelper.cs b/swaggerci/storSimple1200Series/generated/runtime/Helpers/XHelper.cs new file mode 100644 index 000000000000..0afe4d1e8373 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Helpers/XHelper.cs @@ -0,0 +1,75 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal static class XHelper + { + internal static JsonNode Create(JsonType type, TypeCode code, object value) + { + switch (type) + { + case JsonType.Binary : return new XBinary((byte[])value); + case JsonType.Boolean : return new JsonBoolean((bool)value); + case JsonType.Number : return new JsonNumber(value.ToString()); + case JsonType.String : return new JsonString((string)value); + } + + throw new Exception($"JsonType '{type}' does not have a fast conversion"); + } + + internal static bool TryGetElementType(TypeCode code, out JsonType type) + { + switch (code) + { + case TypeCode.Boolean : type = JsonType.Boolean; return true; + case TypeCode.Byte : type = JsonType.Number; return true; + case TypeCode.DateTime : type = JsonType.Date; return true; + case TypeCode.Decimal : type = JsonType.Number; return true; + case TypeCode.Double : type = JsonType.Number; return true; + case TypeCode.Empty : type = JsonType.Null; return true; + case TypeCode.Int16 : type = JsonType.Number; return true; + case TypeCode.Int32 : type = JsonType.Number; return true; + case TypeCode.Int64 : type = JsonType.Number; return true; + case TypeCode.SByte : type = JsonType.Number; return true; + case TypeCode.Single : type = JsonType.Number; return true; + case TypeCode.String : type = JsonType.String; return true; + case TypeCode.UInt16 : type = JsonType.Number; return true; + case TypeCode.UInt32 : type = JsonType.Number; return true; + case TypeCode.UInt64 : type = JsonType.Number; return true; + } + + type = default; + + return false; + } + + internal static JsonType GetElementType(TypeCode code) + { + switch (code) + { + case TypeCode.Boolean : return JsonType.Boolean; + case TypeCode.Byte : return JsonType.Number; + case TypeCode.DateTime : return JsonType.Date; + case TypeCode.Decimal : return JsonType.Number; + case TypeCode.Double : return JsonType.Number; + case TypeCode.Empty : return JsonType.Null; + case TypeCode.Int16 : return JsonType.Number; + case TypeCode.Int32 : return JsonType.Number; + case TypeCode.Int64 : return JsonType.Number; + case TypeCode.SByte : return JsonType.Number; + case TypeCode.Single : return JsonType.Number; + case TypeCode.String : return JsonType.String; + case TypeCode.UInt16 : return JsonType.Number; + case TypeCode.UInt32 : return JsonType.Number; + case TypeCode.UInt64 : return JsonType.Number; + default : return JsonType.Object; + } + + throw new Exception($"TypeCode '{code}' does not have a fast converter"); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/HttpPipeline.cs b/swaggerci/storSimple1200Series/generated/runtime/HttpPipeline.cs new file mode 100644 index 000000000000..281b8c3ce08a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/HttpPipeline.cs @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + using GetEventData = System.Func; + using NextDelegate = System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + + using SignalDelegate = System.Func, System.Threading.Tasks.Task>; + using GetParameterDelegate = System.Func, string, object>; + using SendAsyncStepDelegate = System.Func, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + using PipelineChangeDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>; + using ModuleLoadPipelineDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + using NewRequestPipelineDelegate = System.Action, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + +/* + public class DelegateBasedEventListener : IEventListener + { + private EventListenerDelegate _listener; + public DelegateBasedEventListener(EventListenerDelegate listener) + { + _listener = listener; + } + public CancellationToken Token => CancellationToken.None; + public System.Action Cancel => () => { }; + + + public Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + return _listener(id, token, () => createMessage()); + } + } +*/ + /// + /// This is a necessary extension to the SendAsyncFactory to support the 'generic' delegate format. + /// + public partial class SendAsyncFactory + { + /// + /// This translates a generic-defined delegate for a listener into one that fits our ISendAsync pattern. + /// (Provided to support out-of-module delegation for Azure Cmdlets) + /// + /// The Pipeline Step as a delegate + public SendAsyncFactory(SendAsyncStepDelegate step) => this.implementation = (request, listener, next) => + step( + request, + listener.Token, + listener.Cancel, + (id, token, getEventData) => listener.Signal(id, token, () => { + var data = EventDataConverter.ConvertFrom( getEventData() ) as EventData; + data.Id = id; + data.Cancel = listener.Cancel; + data.RequestMessage = request; + return data; + }), + (req, token, cancel, listenerDelegate) => next.SendAsync(req, listener)); + } + + public partial class HttpPipeline : ISendAsync + { + public HttpPipeline Append(SendAsyncStepDelegate item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStepDelegate item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/HttpPipelineMocking.ps1 b/swaggerci/storSimple1200Series/generated/runtime/HttpPipelineMocking.ps1 new file mode 100644 index 000000000000..790b73ebacbe --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/HttpPipelineMocking.ps1 @@ -0,0 +1,110 @@ +$ErrorActionPreference = "Stop" + +# get the recording path +if (-not $TestRecordingFile) { + $TestRecordingFile = Join-Path $PSScriptRoot 'recording.json' +} + +# create the Http Pipeline Recorder +$Mock = New-Object -Type Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PipelineMock $TestRecordingFile + +# set the recorder to the appropriate mode (default to 'live') +Write-Host -ForegroundColor Green "Running '$TestMode' mode..." +switch ($TestMode) { + 'record' { + Write-Host -ForegroundColor Green "Recording to $TestRecordingFile" + $Mock.SetRecord() + $null = erase -ea 0 $TestRecordingFile + } + 'playback' { + if (-not (Test-Path $TestRecordingFile)) { + Write-Host -fore:yellow "Recording file '$TestRecordingFile' is not present. Tests expecting recorded responses will fail" + } else { + Write-Host -ForegroundColor Green "Using recording $TestRecordingFile" + } + $Mock.SetPlayback() + $Mock.ForceResponseHeaders["Retry-After"] = "0"; + } + default: { + $Mock.SetLive() + } +} + +# overrides for Pester Describe/Context/It + +function Describe( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushDescription($Name) + try { + return pester\Describe -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopDescription() + } +} + +function Context( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushContext($Name) + try { + return pester\Context -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopContext() + } +} + +function It { + [CmdletBinding(DefaultParameterSetName = 'Normal')] + param( + [Parameter(Mandatory = $true, Position = 0)] + [string]$Name, + + [Parameter(Position = 1)] + [ScriptBlock] $Test = { }, + + [System.Collections.IDictionary[]] $TestCases, + + [Parameter(ParameterSetName = 'Pending')] + [Switch] $Pending, + + [Parameter(ParameterSetName = 'Skip')] + [Alias('Ignore')] + [Switch] $Skip + ) + $Mock.PushScenario($Name) + + try { + if ($skip) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Skip + } + if ($pending) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Pending + } + return pester\It -Name $Name -Test $Test -TestCases $TestCases + } + finally { + $null = $Mock.PopScenario() + } +} + +# set the HttpPipelineAppend for all the cmdlets +$PSDefaultParameterValues["*:HttpPipelinePrepend"] = $Mock diff --git a/swaggerci/storSimple1200Series/generated/runtime/IAssociativeArray.cs b/swaggerci/storSimple1200Series/generated/runtime/IAssociativeArray.cs new file mode 100644 index 000000000000..3a7cbb1eeec0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/IAssociativeArray.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +#define DICT_PROPERTIES +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + /// A subset of IDictionary that doesn't implement IEnumerable or IDictionary to work around PowerShell's aggressive formatter + public interface IAssociativeArray + { +#if DICT_PROPERTIES + System.Collections.Generic.IEnumerable Keys { get; } + System.Collections.Generic.IEnumerable Values { get; } + int Count { get; } +#endif + System.Collections.Generic.IDictionary AdditionalProperties { get; } + T this[string index] { get; set; } + void Add(string key, T value); + bool ContainsKey(string key); + bool Remove(string key); + bool TryGetValue(string key, out T value); + void Clear(); + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/IHeaderSerializable.cs b/swaggerci/storSimple1200Series/generated/runtime/IHeaderSerializable.cs new file mode 100644 index 000000000000..2f12bd765add --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/IHeaderSerializable.cs @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + public interface IHeaderSerializable + { + void ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers); + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/ISendAsync.cs b/swaggerci/storSimple1200Series/generated/runtime/ISendAsync.cs new file mode 100644 index 000000000000..8095bf836250 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/ISendAsync.cs @@ -0,0 +1,300 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + /// + /// The interface for sending an HTTP request across the wire. + /// + public interface ISendAsync + { + Task SendAsync(HttpRequestMessage request, IEventListener callback); + } + + public class SendAsyncTerminalFactory : ISendAsyncTerminalFactory, ISendAsync + { + SendAsync implementation; + + public SendAsyncTerminalFactory(SendAsync implementation) => this.implementation = implementation; + public SendAsyncTerminalFactory(ISendAsync implementation) => this.implementation = implementation.SendAsync; + public ISendAsync Create() => this; + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback); + } + + public partial class SendAsyncFactory : ISendAsyncFactory + { + public class Sender : ISendAsync + { + internal ISendAsync next; + internal SendAsyncStep implementation; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback, next); + } + SendAsyncStep implementation; + + public SendAsyncFactory(SendAsyncStep implementation) => this.implementation = implementation; + public ISendAsync Create(ISendAsync next) => new Sender { next = next, implementation = implementation }; + + } + + public class HttpClientFactory : ISendAsyncTerminalFactory, ISendAsync + { + HttpClient client; + public HttpClientFactory() : this(new HttpClient()) + { + } + public HttpClientFactory(HttpClient client) => this.client = client; + public ISendAsync Create() => this; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, callback.Token); + } + + public interface ISendAsyncFactory + { + ISendAsync Create(ISendAsync next); + } + + public interface ISendAsyncTerminalFactory + { + ISendAsync Create(); + } + + public partial class HttpPipeline : ISendAsync + { + private ISendAsync pipeline; + private ISendAsyncTerminalFactory terminal; + private List steps = new List(); + + public HttpPipeline() : this(new HttpClientFactory()) + { + } + + public HttpPipeline(ISendAsyncTerminalFactory terminalStep) + { + if (terminalStep == null) + { + throw new System.ArgumentNullException(nameof(terminalStep), "Terminal Step Factory in HttpPipeline may not be null"); + } + TerminalFactory = terminalStep; + } + + /// + /// Returns an HttpPipeline with the current state of this pipeline. + /// + public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + + public ISendAsyncTerminalFactory TerminalFactory + { + get => terminal; + set + { + if (value == null) + { + throw new System.ArgumentNullException("TerminalFactory in HttpPipeline may not be null"); + } + terminal = value; + } + } + + public ISendAsync Pipeline + { + get + { + // if the pipeline has been created and not invalidated, return it. + if (this.pipeline != null) + { + return this.pipeline; + } + + // create the pipeline from scratch. + var next = terminal.Create(); + foreach (var factory in steps) + { + // skip factories that return null. + next = factory.Create(next) ?? next; + } + return this.pipeline = next; + } + } + + public int Count => steps.Count; + + public HttpPipeline Prepend(ISendAsyncFactory item) + { + if (item != null) + { + steps.Add(item); + pipeline = null; + } + return this; + } + + public HttpPipeline Append(SendAsyncStep item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStep item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Append(ISendAsyncFactory item) + { + if (item != null) + { + steps.Insert(0, item); + pipeline = null; + } + return this; + } + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(item); + } + } + return this; + } + + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(item); + } + } + return this; + } + + // you can use this as the ISendAsync Implementation + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => Pipeline.SendAsync(request, callback); + } + + internal static partial class Extensions + { + internal static HttpRequestMessage CloneAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.Clone(requestUri, method); + } + } + + internal static Task CloneWithContentAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.CloneWithContent(requestUri, method); + } + } + + /// + /// Clones an HttpRequestMessage (without the content) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// + /// + /// A clone of the HttpRequestMessage + internal static HttpRequestMessage Clone(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = new HttpRequestMessage + { + Method = method ?? original.Method, + RequestUri = requestUri ?? original.RequestUri, + Version = original.Version, + }; + + foreach (KeyValuePair prop in original.Properties) + { + clone.Properties.Add(prop); + } + + foreach (KeyValuePair> header in original.Headers) + { + /* + **temporarily skip cloning telemetry related headers** + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + */ + if (!"x-ms-unique-id".Equals(header.Key) && !"x-ms-client-request-id".Equals(header.Key) && !"CommandName".Equals(header.Key) && !"FullCommandName".Equals(header.Key) && !"ParameterSetName".Equals(header.Key) && !"User-Agent".Equals(header.Key)) + { + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + } + + return clone; + } + + /// + /// Clones an HttpRequestMessage (including the content stream and content headers) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// + /// + /// A clone of the HttpRequestMessage + internal static async Task CloneWithContent(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = original.Clone(requestUri, method); + var stream = new System.IO.MemoryStream(); + if (original.Content != null) + { + await original.Content.CopyToAsync(stream).ConfigureAwait(false); + stream.Position = 0; + clone.Content = new StreamContent(stream); + if (original.Content.Headers != null) + { + foreach (var h in original.Content.Headers) + { + clone.Content.Headers.Add(h.Key, h.Value); + } + } + } + return clone; + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/InfoAttribute.cs b/swaggerci/storSimple1200Series/generated/runtime/InfoAttribute.cs new file mode 100644 index 000000000000..0ce212fcd59b --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/InfoAttribute.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + using System; + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Class)] + public class InfoAttribute : Attribute + { + public bool Required { get; set; } = false; + public bool ReadOnly { get; set; } = false; + public Type[] PossibleTypes { get; set; } = new Type[0]; + public string Description { get; set; } = ""; + public string SerializedName { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class CompleterInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class DefaultInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Iso/IsoDate.cs b/swaggerci/storSimple1200Series/generated/runtime/Iso/IsoDate.cs new file mode 100644 index 000000000000..63dd02b3a030 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Iso/IsoDate.cs @@ -0,0 +1,214 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal struct IsoDate + { + internal int Year { get; set; } // 0-3000 + + internal int Month { get; set; } // 1-12 + + internal int Day { get; set; } // 1-31 + + internal int Hour { get; set; } // 0-24 + + internal int Minute { get; set; } // 0-60 (60 is a special case) + + internal int Second { get; set; } // 0-60 (60 is used for leap seconds) + + internal double Millisecond { get; set; } // 0-999.9... + + internal TimeSpan Offset { get; set; } + + internal DateTimeKind Kind { get; set; } + + internal TimeSpan TimeOfDay => new TimeSpan(Hour, Minute, Second); + + internal DateTime ToDateTime() + { + if (Kind == DateTimeKind.Utc || Offset == TimeSpan.Zero) + { + return new DateTime(Year, Month, Day, Hour, Minute, Second, (int)Millisecond, DateTimeKind.Utc); + } + + return ToDateTimeOffset().DateTime; + } + + internal DateTimeOffset ToDateTimeOffset() + { + return new DateTimeOffset( + Year, + Month, + Day, + Hour, + Minute, + Second, + (int)Millisecond, + Offset + ); + } + + internal DateTime ToUtcDateTime() + { + return ToDateTimeOffset().UtcDateTime; + } + + public override string ToString() + { + var sb = new StringBuilder(); + + // yyyy-MM-dd + sb.Append($"{Year}-{Month:00}-{Day:00}"); + + if (TimeOfDay > new TimeSpan(0)) + { + sb.Append($"T{Hour:00}:{Minute:00}"); + + if (TimeOfDay.Seconds > 0) + { + sb.Append($":{Second:00}"); + } + } + + if (Offset.Ticks == 0) + { + sb.Append('Z'); // UTC + } + else + { + if (Offset.Ticks >= 0) + { + sb.Append('+'); + } + + sb.Append($"{Offset.Hours:00}:{Offset.Minutes:00}"); + } + + return sb.ToString(); + } + + internal static IsoDate FromDateTimeOffset(DateTimeOffset date) + { + return new IsoDate { + Year = date.Year, + Month = date.Month, + Day = date.Day, + Hour = date.Hour, + Minute = date.Minute, + Second = date.Second, + Offset = date.Offset, + Kind = date.Offset == TimeSpan.Zero ? DateTimeKind.Utc : DateTimeKind.Unspecified + }; + } + + private static readonly char[] timeSeperators = { ':', '.' }; + + internal static IsoDate Parse(string text) + { + var tzIndex = -1; + var timeIndex = text.IndexOf('T'); + + var builder = new IsoDate { Day = 1, Month = 1 }; + + // TODO: strip the time zone offset off the end + string dateTime = text; + string timeZone = null; + + if (dateTime.IndexOf('Z') > -1) + { + tzIndex = dateTime.LastIndexOf('Z'); + + builder.Kind = DateTimeKind.Utc; + } + else if (dateTime.LastIndexOf('+') > 10) + { + tzIndex = dateTime.LastIndexOf('+'); + } + else if (dateTime.LastIndexOf('-') > 10) + { + tzIndex = dateTime.LastIndexOf('-'); + } + + if (tzIndex > -1) + { + timeZone = dateTime.Substring(tzIndex); + dateTime = dateTime.Substring(0, tzIndex); + } + + string date = (timeIndex == -1) ? dateTime : dateTime.Substring(0, timeIndex); + + var dateParts = date.Split(Seperator.Dash); // '-' + + for (int i = 0; i < dateParts.Length; i++) + { + var part = dateParts[i]; + + switch (i) + { + case 0: builder.Year = int.Parse(part); break; + case 1: builder.Month = int.Parse(part); break; + case 2: builder.Day = int.Parse(part); break; + } + } + + if (timeIndex > -1) + { + string[] timeParts = dateTime.Substring(timeIndex + 1).Split(timeSeperators); + + for (int i = 0; i < timeParts.Length; i++) + { + var part = timeParts[i]; + + switch (i) + { + case 0: builder.Hour = int.Parse(part); break; + case 1: builder.Minute = int.Parse(part); break; + case 2: builder.Second = int.Parse(part); break; + case 3: builder.Millisecond = double.Parse("0." + part) * 1000; break; + } + } + } + + if (timeZone != null && timeZone != "Z") + { + var hours = int.Parse(timeZone.Substring(1, 2)); + var minutes = int.Parse(timeZone.Substring(4, 2)); + + if (timeZone[0] == '-') + { + hours = -hours; + minutes = -minutes; + } + + builder.Offset = new TimeSpan(hours, minutes, 0); + } + + return builder; + } + } + + /* + YYYY # eg 1997 + YYYY-MM # eg 1997-07 + YYYY-MM-DD # eg 1997-07-16 + YYYY-MM-DDThh:mmTZD # eg 1997-07-16T19:20+01:00 + YYYY-MM-DDThh:mm:ssTZD # eg 1997-07-16T19:20:30+01:00 + YYYY-MM-DDThh:mm:ss.sTZD # eg 1997-07-16T19:20:30.45+01:00 + + where: + + YYYY = four-digit year + MM = two-digit month (01=January, etc.) + DD = two-digit day of month (01 through 31) + hh = two digits of hour (00 through 23) (am/pm NOT allowed) + mm = two digits of minute (00 through 59) + ss = two digits of second (00 through 59) + s = one or more digits representing a decimal fraction of a second + TZD = time zone designator (Z or +hh:mm or -hh:mm) + */ +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/JsonType.cs b/swaggerci/storSimple1200Series/generated/runtime/JsonType.cs new file mode 100644 index 000000000000..5e46d6ab1376 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/JsonType.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal enum JsonType + { + Null = 0, + Object = 1, + Array = 2, + Binary = 3, + Boolean = 4, + Date = 5, + Number = 6, + String = 7 + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/MessageAttribute.cs b/swaggerci/storSimple1200Series/generated/runtime/MessageAttribute.cs new file mode 100644 index 000000000000..171de31dacef --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/MessageAttribute.cs @@ -0,0 +1,360 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Linq; + using System.Management.Automation; + using System.Text; + + [AttributeUsage(AttributeTargets.All)] + public class GenericBreakingChangeAttribute : Attribute + { + private string _message; + //A dexcription of what the change is about, non mandatory + public string ChangeDescription { get; set; } = null; + + //The version the change is effective from, non mandatory + public string DeprecateByVersion { get; } + public bool DeprecateByVersionSet { get; } = false; + + //The date on which the change comes in effect + public DateTime ChangeInEfectByDate { get; } + public bool ChangeInEfectByDateSet { get; } = false; + + //Old way of calling the cmdlet + public string OldWay { get; set; } + //New way fo calling the cmdlet + public string NewWay { get; set; } + + public GenericBreakingChangeAttribute(string message) + { + _message = message; + } + + public GenericBreakingChangeAttribute(string message, string deprecateByVersion) + { + _message = message; + this.DeprecateByVersion = deprecateByVersion; + this.DeprecateByVersionSet = true; + } + + public GenericBreakingChangeAttribute(string message, string deprecateByVersion, string changeInEfectByDate) + { + _message = message; + this.DeprecateByVersion = deprecateByVersion; + this.DeprecateByVersionSet = true; + + if (DateTime.TryParse(changeInEfectByDate, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.ChangeInEfectByDate = result; + this.ChangeInEfectByDateSet = true; + } + } + + public DateTime getInEffectByDate() + { + return this.ChangeInEfectByDate.Date; + } + + + /** + * This function prints out the breaking change message for the attribute on the cmdline + * */ + public void PrintCustomAttributeInfo(Action writeOutput) + { + + if (!GetAttributeSpecificMessage().StartsWith(Environment.NewLine)) + { + writeOutput(Environment.NewLine); + } + writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); + + + if (!string.IsNullOrWhiteSpace(ChangeDescription)) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesChangeDescriptionMessage, this.ChangeDescription)); + } + + if (ChangeInEfectByDateSet) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByDateMessage, this.ChangeInEfectByDate.ToString("d"))); + } + + if (DeprecateByVersionSet) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); + } + + if (OldWay != null && NewWay != null) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesUsageChangeMessageConsole, OldWay, NewWay)); + } + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + + protected virtual string GetAttributeSpecificMessage() + { + return _message; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class CmdletBreakingChangeAttribute : GenericBreakingChangeAttribute + { + + public string ReplacementCmdletName { get; set; } + + public CmdletBreakingChangeAttribute() : + base(string.Empty) + { + } + + public CmdletBreakingChangeAttribute(string deprecateByVersione) : + base(string.Empty, deprecateByVersione) + { + } + + public CmdletBreakingChangeAttribute(string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + } + + protected override string GetAttributeSpecificMessage() + { + if (string.IsNullOrWhiteSpace(ReplacementCmdletName)) + { + return Resources.BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement; + } + else + { + return string.Format(Resources.BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement, ReplacementCmdletName); + } + } + } + + [AttributeUsage(AttributeTargets.All)] + public class ParameterSetBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string[] ChangedParameterSet { set; get; } + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet) : + base(string.Empty) + { + ChangedParameterSet = changedParameterSet; + } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersione) : + base(string.Empty, deprecateByVersione) + { + ChangedParameterSet = changedParameterSet; + } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + ChangedParameterSet = changedParameterSet; + } + + protected override string GetAttributeSpecificMessage() + { + + return Resources.BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement; + + } + + public bool IsApplicableToInvocation(InvocationInfo invocation, string parameterSetName) + { + if (ChangedParameterSet != null) + return ChangedParameterSet.Contains(parameterSetName); + return false; + } + + } + + [AttributeUsage(AttributeTargets.All)] + public class PreviewMessageAttribute : Attribute + { + public string _message; + + public PreviewMessageAttribute() + { + this._message = Resources.PreviewCmdletMessage; + } + + public PreviewMessageAttribute(string message) + { + this._message = message; + } + + public void PrintCustomAttributeInfo(System.Management.Automation.PSCmdlet psCmdlet) + { + psCmdlet.WriteWarning(this._message); + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class ParameterBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string NameOfParameterChanging { get; } + + public string ReplaceMentCmdletParameterName { get; set; } = null; + + public bool IsBecomingMandatory { get; set; } = false; + + public String OldParamaterType { get; set; } + + public String NewParameterType { get; set; } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging) : + base(string.Empty) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion) : + base(string.Empty, deprecateByVersion) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + if (!string.IsNullOrWhiteSpace(ReplaceMentCmdletParameterName)) + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplacedMandatory, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplaced, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + } + else + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterMandatoryNow, NameOfParameterChanging)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterChanging, NameOfParameterChanging)); + } + } + + //See if the type of the param is changing + if (OldParamaterType != null && !string.IsNullOrWhiteSpace(NewParameterType)) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterTypeChange, OldParamaterType, NewParameterType)); + } + return message.ToString(); + } + + /// + /// See if the bound parameters contain the current parameter, if they do + /// then the attribbute is applicable + /// If the invocationInfo is null we return true + /// + /// + /// bool + public override bool IsApplicableToInvocation(InvocationInfo invocationInfo) + { + bool? applicable = invocationInfo == null ? true : invocationInfo.BoundParameters?.Keys?.Contains(this.NameOfParameterChanging); + return applicable.HasValue ? applicable.Value : false; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class OutputBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string DeprecatedCmdLetOutputType { get; } + + //This is still a String instead of a Type as this + //might be undefined at the time of adding the attribute + public string ReplacementCmdletOutputType { get; set; } + + public string[] DeprecatedOutputProperties { get; set; } + + public string[] NewOutputProperties { get; set; } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType) : + base(string.Empty) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion) : + base(string.Empty, deprecateByVersion) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + + //check for the deprecation scenario + if (string.IsNullOrWhiteSpace(ReplacementCmdletOutputType) && NewOutputProperties == null && DeprecatedOutputProperties == null && string.IsNullOrWhiteSpace(ChangeDescription)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputTypeDeprecated, DeprecatedCmdLetOutputType)); + } + else + { + if (!string.IsNullOrWhiteSpace(ReplacementCmdletOutputType)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange1, DeprecatedCmdLetOutputType, ReplacementCmdletOutputType)); + } + else + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange2, DeprecatedCmdLetOutputType)); + } + + if (DeprecatedOutputProperties != null && DeprecatedOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesRemoved); + foreach (string property in DeprecatedOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + + if (NewOutputProperties != null && NewOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesAdded); + foreach (string property in NewOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + } + return message.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/MessageAttributeHelper.cs b/swaggerci/storSimple1200Series/generated/runtime/MessageAttributeHelper.cs new file mode 100644 index 000000000000..3faffc0e40a8 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/MessageAttributeHelper.cs @@ -0,0 +1,161 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Linq; + using System.Management.Automation; + using System.Reflection; + using System.Text; + using System.Threading.Tasks; + public class MessageAttributeHelper + { + public const string BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK = "https://aka.ms/azps-changewarnings"; + public const string SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME = "SuppressAzurePowerShellBreakingChangeWarnings"; + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And reads all the deprecation attributes attached to it + * Prints a message on the cmdline For each of the attribute found + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + * */ + public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { + bool supressWarningOrError = false; + + try + { + supressWarningOrError = bool.Parse(System.Environment.GetEnvironmentVariable(SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME)); + } + catch (Exception) + { + //no action + } + + if (supressWarningOrError) + { + //Do not process the attributes at runtime... The env variable to override the warning messages is set + return; + } + + List attributes = new List(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet)); + StringBuilder sb = new StringBuilder(); + Action appendBreakingChangeInfo = (string s) => sb.Append(s); + + if (attributes != null && attributes.Count > 0) + { + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); + + foreach (GenericBreakingChangeAttribute attribute in attributes) + { + attribute.PrintCustomAttributeInfo(appendBreakingChangeInfo); + } + + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + + psCmdlet.WriteWarning(sb.ToString()); + } + + List previewAttributes = new List(GetAllPreviewAttributesInType(commandInfo, invocationInfo)); + + if (previewAttributes != null && previewAttributes.Count > 0) + { + foreach (PreviewMessageAttribute attribute in previewAttributes) + { + attribute.PrintCustomAttributeInfo(psCmdlet); + } + } + } + + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And returns all the deprecation attributes attached to it + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + **/ + private static IEnumerable GetAllBreakingChangeAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet) + { + List attributeList = new List(); + + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.GetType() == typeof(ParameterSetBreakingChangeAttribute) ? ((ParameterSetBreakingChangeAttribute)e).IsApplicableToInvocation(invocationInfo, parameterSet) : e.IsApplicableToInvocation(invocationInfo)); + } + private static IEnumerable GetAllPreviewAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + List attributeList = new List(); + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.IsApplicableToInvocation(invocationInfo)); + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/Method.cs b/swaggerci/storSimple1200Series/generated/runtime/Method.cs new file mode 100644 index 000000000000..81f873cb968f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Method.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + internal static class Method + { + internal static System.Net.Http.HttpMethod Get = System.Net.Http.HttpMethod.Get; + internal static System.Net.Http.HttpMethod Put = System.Net.Http.HttpMethod.Put; + internal static System.Net.Http.HttpMethod Head = System.Net.Http.HttpMethod.Head; + internal static System.Net.Http.HttpMethod Post = System.Net.Http.HttpMethod.Post; + internal static System.Net.Http.HttpMethod Delete = System.Net.Http.HttpMethod.Delete; + internal static System.Net.Http.HttpMethod Options = System.Net.Http.HttpMethod.Options; + internal static System.Net.Http.HttpMethod Trace = System.Net.Http.HttpMethod.Trace; + internal static System.Net.Http.HttpMethod Patch = new System.Net.Http.HttpMethod("PATCH"); + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Models/JsonMember.cs b/swaggerci/storSimple1200Series/generated/runtime/Models/JsonMember.cs new file mode 100644 index 000000000000..0cf2ad1ae318 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Models/JsonMember.cs @@ -0,0 +1,83 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; +using System.Runtime.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + + + internal sealed class JsonMember + { + private readonly TypeDetails type; + + private readonly Func getter; + private readonly Action setter; + + internal JsonMember(PropertyInfo property, int defaultOrder) + { + getter = property.GetValue; + setter = property.SetValue; + + var dataMember = property.GetCustomAttribute(); + + Name = dataMember?.Name ?? property.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(property.PropertyType); + + CanRead = property.CanRead; + } + + internal JsonMember(FieldInfo field, int defaultOrder) + { + getter = field.GetValue; + setter = field.SetValue; + + var dataMember = field.GetCustomAttribute(); + + Name = dataMember?.Name ?? field.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(field.FieldType); + + CanRead = true; + } + + internal string Name { get; } + + internal int Order { get; } + + internal TypeDetails TypeDetails => type; + + internal Type Type => type.NonNullType; + + internal bool IsList => type.IsList; + + // Arrays, Sets, ... + internal Type ElementType => type.ElementType; + + internal IJsonConverter Converter => type.JsonConverter; + + internal bool EmitDefaultValue { get; } + + internal bool IsStringLike => type.IsStringLike; + + internal object DefaultValue => type.DefaultValue; + + internal bool CanRead { get; } + + #region Helpers + + internal object GetValue(object instance) => getter(instance); + + internal void SetValue(object instance, object value) => setter(instance, value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Models/JsonModel.cs b/swaggerci/storSimple1200Series/generated/runtime/Models/JsonModel.cs new file mode 100644 index 000000000000..39056678c687 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Models/JsonModel.cs @@ -0,0 +1,89 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal class JsonModel + { + private Dictionary map; + private readonly object _sync = new object(); + + private JsonModel(Type type, List members) + { + Type = type ?? throw new ArgumentNullException(nameof(type)); + Members = members ?? throw new ArgumentNullException(nameof(members)); + } + + internal string Name => Type.Name; + + internal Type Type { get; } + + internal List Members { get; } + + internal JsonMember this[string name] + { + get + { + if (map == null) + { + lock (_sync) + { + if (map == null) + { + map = new Dictionary(); + + foreach (JsonMember m in Members) + { + map[m.Name.ToLower()] = m; + } + } + } + } + + + map.TryGetValue(name.ToLower(), out JsonMember member); + + return member; + } + } + + internal static JsonModel FromType(Type type) + { + var members = new List(); + + int i = 0; + + // BindingFlags.Instance | BindingFlags.Public + + foreach (var member in type.GetFields()) + { + if (member.IsStatic) continue; + + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + foreach (var member in type.GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + members.Sort((a, b) => a.Order.CompareTo(b.Order)); // inline sort + + return new JsonModel(type, members); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Models/JsonModelCache.cs b/swaggerci/storSimple1200Series/generated/runtime/Models/JsonModelCache.cs new file mode 100644 index 000000000000..f30a50cfa71a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Models/JsonModelCache.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Runtime.CompilerServices; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal static class JsonModelCache + { + private static readonly ConditionalWeakTable cache + = new ConditionalWeakTable(); + + internal static JsonModel Get(Type type) => cache.GetValue(type, Create); + + private static JsonModel Create(Type type) => JsonModel.FromType(type); + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/JsonArray.cs b/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/JsonArray.cs new file mode 100644 index 000000000000..2112d225e190 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/JsonArray.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public abstract partial class JsonArray : JsonNode, IEnumerable + { + internal override JsonType Type => JsonType.Array; + + internal abstract JsonType? ElementType { get; } + + public abstract int Count { get; } + + internal virtual bool IsSet => false; + + internal bool IsEmpty => Count == 0; + + #region IEnumerable + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + #endregion + + #region Static Helpers + + internal static JsonArray Create(short[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(int[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(long[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(decimal[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(float[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(string[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(XBinary[] values) + => new XImmutableArray(values); + + #endregion + + internal static new JsonArray Parse(string text) + => (JsonArray)JsonNode.Parse(text); + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/XImmutableArray.cs b/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/XImmutableArray.cs new file mode 100644 index 000000000000..34004e5c7816 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/XImmutableArray.cs @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal sealed class XImmutableArray : JsonArray, IEnumerable + { + private readonly T[] values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XImmutableArray(T[] values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Length; + + public bool IsReadOnly => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + #region Static Constructor + + internal XImmutableArray Create(T[] items) + { + return new XImmutableArray(items); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/XList.cs b/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/XList.cs new file mode 100644 index 000000000000..70c1d7cba070 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/XList.cs @@ -0,0 +1,64 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal sealed class XList : JsonArray, IEnumerable + { + private readonly IList values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XList(IList values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Count; + + public bool IsReadOnly => values.IsReadOnly; + + #region IList + + public void Add(T value) + { + values.Add(value); + } + + public bool Contains(T value) => values.Contains(value); + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/XNodeArray.cs b/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/XNodeArray.cs new file mode 100644 index 000000000000..41f529477b8c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -0,0 +1,68 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed partial class XNodeArray : JsonArray, ICollection + { + private readonly List items; + + internal XNodeArray() + { + items = new List(); + } + + internal XNodeArray(params JsonNode[] values) + { + items = new List(values); + } + + public override JsonNode this[int index] => items[index]; + + internal override JsonType? ElementType => null; + + public bool IsReadOnly => false; + + public override int Count => items.Count; + + #region ICollection Members + + public void Add(JsonNode item) + { + items.Add(item); + } + + void ICollection.Clear() + { + items.Clear(); + } + + public bool Contains(JsonNode item) => items.Contains(item); + + void ICollection.CopyTo(JsonNode[] array, int arrayIndex) + { + items.CopyTo(array, arrayIndex); + } + + public bool Remove(JsonNode item) + { + return items.Remove(item); + } + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/XSet.cs b/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/XSet.cs new file mode 100644 index 000000000000..3c632445624f --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Nodes/Collections/XSet.cs @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal sealed class XSet : JsonArray, IEnumerable + { + private readonly HashSet values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XSet(IEnumerable values) + : this(new HashSet(values)) + { } + + internal XSet(HashSet values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + internal override JsonType Type => JsonType.Array; + + internal override JsonType? ElementType => elementType; + + public bool IsReadOnly => true; + + public override int Count => values.Count; + + internal override bool IsSet => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + internal HashSet AsHashSet() => values; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonBoolean.cs b/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonBoolean.cs new file mode 100644 index 000000000000..5cc5ad338806 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonBoolean.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal sealed partial class JsonBoolean : JsonNode + { + internal static readonly JsonBoolean True = new JsonBoolean(true); + internal static readonly JsonBoolean False = new JsonBoolean(false); + + internal JsonBoolean(bool value) + { + Value = value; + } + + internal bool Value { get; } + + internal override JsonType Type => JsonType.Boolean; + + internal static new JsonBoolean Parse(string text) + { + switch (text) + { + case "false": return False; + case "true": return True; + + default: throw new ArgumentException($"Expected true or false. Was {text}."); + } + } + + #region Implicit Casts + + public static implicit operator bool(JsonBoolean data) => data.Value; + + public static implicit operator JsonBoolean(bool data) => new JsonBoolean(data); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonDate.cs b/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonDate.cs new file mode 100644 index 000000000000..3eab720dc7f4 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonDate.cs @@ -0,0 +1,173 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + + + internal sealed partial class JsonDate : JsonNode, IEquatable, IComparable + { + internal static bool AssumeUtcWhenKindIsUnspecified = true; + + private readonly DateTimeOffset value; + + internal JsonDate(DateTime value) + { + if (value.Kind == DateTimeKind.Unspecified && AssumeUtcWhenKindIsUnspecified) + { + value = DateTime.SpecifyKind(value, DateTimeKind.Utc); + } + + this.value = value; + } + + internal JsonDate(DateTimeOffset value) + { + this.value = value; + } + + internal override JsonType Type => JsonType.Date; + + #region Helpers + + internal DateTimeOffset ToDateTimeOffset() + { + return value; + } + + internal DateTime ToDateTime() + { + if (value.Offset == TimeSpan.Zero) + { + return value.UtcDateTime; + } + + return value.DateTime; + } + + internal DateTime ToUtcDateTime() => value.UtcDateTime; + + internal int ToUnixTimeSeconds() + { + return (int)value.ToUnixTimeSeconds(); + } + + internal long ToUnixTimeMilliseconds() + { + return (int)value.ToUnixTimeMilliseconds(); + } + + internal string ToIsoString() + { + return IsoDate.FromDateTimeOffset(value).ToString(); + } + + #endregion + + public override string ToString() + { + return ToIsoString(); + } + + internal static new JsonDate Parse(string text) + { + if (text == null) throw new ArgumentNullException(nameof(text)); + + // TODO support: unixtimeseconds.partialseconds + + if (text.Length > 4 && _IsNumber(text)) // UnixTime + { + var date = DateTimeOffset.FromUnixTimeSeconds(long.Parse(text)); + + return new JsonDate(date); + } + else if (text.Length <= 4 || text[4] == '-') // ISO: 2012- + { + return new JsonDate(IsoDate.Parse(text).ToDateTimeOffset()); + } + else + { + // NOT ISO ENCODED + // "Thu, 5 Apr 2012 16:59:01 +0200", + return new JsonDate(DateTimeOffset.Parse(text)); + } + } + + private static bool _IsNumber(string text) + { + foreach (var c in text) + { + if (!char.IsDigit(c)) return false; + } + + return true; + } + + internal static JsonDate FromUnixTime(int seconds) + { + return new JsonDate(DateTimeOffset.FromUnixTimeSeconds(seconds)); + } + + internal static JsonDate FromUnixTime(double seconds) + { + var milliseconds = (long)(seconds * 1000d); + + return new JsonDate(DateTimeOffset.FromUnixTimeMilliseconds(milliseconds)); + } + + #region Implicit Casts + + public static implicit operator DateTimeOffset(JsonDate value) + => value.ToDateTimeOffset(); + + public static implicit operator DateTime(JsonDate value) + => value.ToDateTime(); + + // From Date + public static implicit operator JsonDate(DateTimeOffset value) + { + return new JsonDate(value); + } + + public static implicit operator JsonDate(DateTime value) + { + return new JsonDate(value); + } + + // From String + public static implicit operator JsonDate(string value) + { + return Parse(value); + } + + #endregion + + #region Equality + + public override bool Equals(object obj) + { + return obj is JsonDate date && date.value == this.value; + } + + public bool Equals(JsonDate other) + { + return this.value == other.value; + } + + public override int GetHashCode() => value.GetHashCode(); + + #endregion + + #region IComparable Members + + int IComparable.CompareTo(JsonDate other) + { + return value.CompareTo(other.value); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonNode.cs b/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonNode.cs new file mode 100644 index 000000000000..8a2a890b02f3 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonNode.cs @@ -0,0 +1,250 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + + + public abstract partial class JsonNode + { + internal abstract JsonType Type { get; } + + public virtual JsonNode this[int index] => throw new NotImplementedException(); + + public virtual JsonNode this[string name] + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + #region Type Helpers + + internal bool IsArray => Type == JsonType.Array; + + internal bool IsDate => Type == JsonType.Date; + + internal bool IsObject => Type == JsonType.Object; + + internal bool IsNumber => Type == JsonType.Number; + + internal bool IsNull => Type == JsonType.Null; + + #endregion + + internal void WriteTo(TextWriter textWriter, bool pretty = true) + { + var writer = new JsonWriter(textWriter, pretty); + + writer.WriteNode(this); + } + + internal T As() + where T : new() + => new JsonSerializer().Deseralize((JsonObject)this); + + internal T[] ToArrayOf() + { + return (T[])new JsonSerializer().DeserializeArray(typeof(T[]), (JsonArray)this); + } + + #region ToString Overrides + + public override string ToString() => ToString(pretty: true); + + internal string ToString(bool pretty) + { + var sb = new StringBuilder(); + + using (var writer = new StringWriter(sb)) + { + WriteTo(writer, pretty); + + return sb.ToString(); + } + } + + #endregion + + #region Static Constructors + + internal static JsonNode Parse(string text) + { + return Parse(new SourceReader(new StringReader(text))); + } + + internal static JsonNode Parse(TextReader textReader) + => Parse(new SourceReader(textReader)); + + private static JsonNode Parse(SourceReader sourceReader) + { + using (var parser = new JsonParser(sourceReader)) + { + return parser.ReadNode(); + } + } + + internal static JsonNode FromObject(object instance) + => new JsonSerializer().Serialize(instance); + + #endregion + + #region Implict Casts + + public static implicit operator string(JsonNode node) => node.ToString(); + + #endregion + + #region Explict Casts + + public static explicit operator DateTime(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date: + return ((JsonDate)node).ToDateTime(); + + case JsonType.String: + return JsonDate.Parse(node.ToString()).ToDateTime(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num).UtcDateTime; + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)).UtcDateTime; + } + } + + throw new ConversionException(node, typeof(DateTime)); + } + + public static explicit operator DateTimeOffset(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date : return ((JsonDate)node).ToDateTimeOffset(); + case JsonType.String : return JsonDate.Parse(node.ToString()).ToDateTimeOffset(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num); + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)); + } + + } + + throw new ConversionException(node, typeof(DateTimeOffset)); + } + + public static explicit operator float(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return float.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(float)); + } + + public static explicit operator double(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return double.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(double)); + } + + public static explicit operator decimal(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return decimal.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(decimal)); + } + + public static explicit operator Guid(JsonNode node) + => new Guid(node.ToString()); + + public static explicit operator short(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return short.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(short)); + } + + public static explicit operator int(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return int.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(int)); + } + + public static explicit operator long(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return long.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(long)); + } + + public static explicit operator bool(JsonNode node) + => ((JsonBoolean)node).Value; + + public static explicit operator ushort(JsonNode node) + => (JsonNumber)node; + + public static explicit operator uint(JsonNode node) + => (JsonNumber)node; + + public static explicit operator ulong(JsonNode node) + => (JsonNumber)node; + + public static explicit operator TimeSpan(JsonNode node) + => TimeSpan.Parse(node.ToString()); + + public static explicit operator Uri(JsonNode node) + { + if (node.Type == JsonType.String) + { + return new Uri(node.ToString()); + } + + throw new ConversionException(node, typeof(Uri)); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonNumber.cs b/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonNumber.cs new file mode 100644 index 000000000000..4c5eeb78345d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonNumber.cs @@ -0,0 +1,109 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed partial class JsonNumber : JsonNode + { + private readonly string value; + private readonly bool overflows = false; + + internal JsonNumber(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal JsonNumber(int value) + { + this.value = value.ToString(); + } + + internal JsonNumber(long value) + { + this.value = value.ToString(); + + if (value > 9007199254740991) + { + overflows = true; + } + } + + internal JsonNumber(float value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal JsonNumber(double value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal override JsonType Type => JsonType.Number; + + internal string Value => value; + + #region Helpers + + internal bool Overflows => overflows; + + internal bool IsInteger => !value.Contains("."); + + internal bool IsFloat => value.Contains("."); + + #endregion + + #region Casting + + public static implicit operator byte(JsonNumber number) + => byte.Parse(number.Value); + + public static implicit operator short(JsonNumber number) + => short.Parse(number.Value); + + public static implicit operator int(JsonNumber number) + => int.Parse(number.Value); + + public static implicit operator long(JsonNumber number) + => long.Parse(number.value); + + public static implicit operator UInt16(JsonNumber number) + => ushort.Parse(number.Value); + + public static implicit operator UInt32(JsonNumber number) + => uint.Parse(number.Value); + + public static implicit operator UInt64(JsonNumber number) + => ulong.Parse(number.Value); + + public static implicit operator decimal(JsonNumber number) + => decimal.Parse(number.Value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator Double(JsonNumber number) + => double.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator float(JsonNumber number) + => float.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator JsonNumber(short data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(int data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(long data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(Single data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(double data) + => new JsonNumber(data.ToString()); + + #endregion + + public override string ToString() => value; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonObject.cs b/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonObject.cs new file mode 100644 index 000000000000..0d32bf50f3fb --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonObject.cs @@ -0,0 +1,172 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public partial class JsonObject : JsonNode, IDictionary + { + private readonly Dictionary items; + + internal JsonObject() + { + items = new Dictionary(); + } + + internal JsonObject(IEnumerable> properties) + { + if (properties == null) throw new ArgumentNullException(nameof(properties)); + + items = new Dictionary(); + + foreach (var field in properties) + { + items.Add(field.Key, field.Value); + } + } + + #region IDictionary Constructors + + internal JsonObject(IDictionary dic) + { + items = new Dictionary(dic.Count); + + foreach (var pair in dic) + { + Add(pair.Key, pair.Value); + } + } + + #endregion + + internal override JsonType Type => JsonType.Object; + + #region Add Overloads + + public void Add(string name, JsonNode value) => + items.Add(name, value); + + public void Add(string name, byte[] value) => + items.Add(name, new XBinary(value)); + + public void Add(string name, DateTime value) => + items.Add(name, new JsonDate(value)); + + public void Add(string name, int value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, long value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, float value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, double value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, string value) => + items.Add(name, new JsonString(value)); + + public void Add(string name, bool value) => + items.Add(name, new JsonBoolean(value)); + + public void Add(string name, Uri url) => + items.Add(name, new JsonString(url.AbsoluteUri)); + + public void Add(string name, string[] values) => + items.Add(name, new XImmutableArray(values)); + + public void Add(string name, int[] values) => + items.Add(name, new XImmutableArray(values)); + + #endregion + + #region ICollection> Members + + void ICollection>.Add(KeyValuePair item) + { + items.Add(item.Key, item.Value); + } + + void ICollection>.Clear() + { + items.Clear(); + } + + bool ICollection>.Contains(KeyValuePair item) => + throw new NotImplementedException(); + + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) => + throw new NotImplementedException(); + + + int ICollection>.Count => items.Count; + + bool ICollection>.IsReadOnly => false; + + bool ICollection>.Remove(KeyValuePair item) => + throw new NotImplementedException(); + + #endregion + + #region IDictionary Members + + public bool ContainsKey(string key) => items.ContainsKey(key); + + public ICollection Keys => items.Keys; + + public bool Remove(string key) => items.Remove(key); + + public bool TryGetValue(string key, out JsonNode value) => + items.TryGetValue(key, out value); + + public ICollection Values => items.Values; + + public override JsonNode this[string key] + { + get => items[key]; + set => items[key] = value; + } + + #endregion + + #region IEnumerable + + IEnumerator> IEnumerable>.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + + #region Helpers + + internal static new JsonObject FromObject(object instance) => + (JsonObject)new JsonSerializer().Serialize(instance); + + #endregion + + #region Static Constructors + + internal static JsonObject FromStream(Stream stream) + { + using (var tr = new StreamReader(stream)) + { + return (JsonObject)Parse(tr); + } + } + + internal static new JsonObject Parse(string text) + { + return (JsonObject)JsonNode.Parse(text); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonString.cs b/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonString.cs new file mode 100644 index 000000000000..b04312578697 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Nodes/JsonString.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed partial class JsonString : JsonNode, IEquatable + { + private readonly string value; + + internal JsonString(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal override JsonType Type => JsonType.String; + + internal string Value => value; + + internal int Length => value.Length; + + #region #region Implicit Casts + + public static implicit operator string(JsonString data) => data.Value; + + public static implicit operator JsonString(string value) => new JsonString(value); + + #endregion + + public override int GetHashCode() => value.GetHashCode(); + + public override string ToString() => value; + + #region IEquatable + + bool IEquatable.Equals(JsonString other) => this.Value == other.Value; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Nodes/XBinary.cs b/swaggerci/storSimple1200Series/generated/runtime/Nodes/XBinary.cs new file mode 100644 index 000000000000..526cfbd3d1cc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Nodes/XBinary.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal sealed class XBinary : JsonNode + { + private readonly byte[] _value; + private readonly string _base64; + + internal XBinary(byte[] value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal XBinary(string base64EncodedString) + { + _base64 = base64EncodedString ?? throw new ArgumentNullException(nameof(base64EncodedString)); + } + + internal override JsonType Type => JsonType.Binary; + + internal byte[] Value => _value ?? Convert.FromBase64String(_base64); + + #region #region Implicit Casts + + public static implicit operator byte[] (XBinary data) => data.Value; + + public static implicit operator XBinary(byte[] data) => new XBinary(data); + + #endregion + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => _base64 ?? Convert.ToBase64String(_value); + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Nodes/XNull.cs b/swaggerci/storSimple1200Series/generated/runtime/Nodes/XNull.cs new file mode 100644 index 000000000000..de4f94891ee1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Nodes/XNull.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal sealed class XNull : JsonNode + { + internal static readonly XNull Instance = new XNull(); + + private XNull() { } + + internal override JsonType Type => JsonType.Null; + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Parser/Exceptions/ParseException.cs b/swaggerci/storSimple1200Series/generated/runtime/Parser/Exceptions/ParseException.cs new file mode 100644 index 000000000000..3632189cb3b5 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Parser/Exceptions/ParseException.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal class ParserException : Exception + { + internal ParserException(string message) + : base(message) + { } + + internal ParserException(string message, SourceLocation location) + : base(message) + { + + Location = location; + } + + internal SourceLocation Location { get; } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Parser/JsonParser.cs b/swaggerci/storSimple1200Series/generated/runtime/Parser/JsonParser.cs new file mode 100644 index 000000000000..9c7dfbd5736d --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Parser/JsonParser.cs @@ -0,0 +1,180 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public class JsonParser : IDisposable + { + private readonly TokenReader reader; + + internal JsonParser(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonParser(SourceReader sourceReader) + { + if (sourceReader == null) + throw new ArgumentNullException(nameof(sourceReader)); + + this.reader = new TokenReader(new JsonTokenizer(sourceReader)); + + this.reader.Next(); // Start with the first token + } + + internal IEnumerable ReadNodes() + { + JsonNode node; + + while ((node = ReadNode()) != null) yield return node; + } + + internal JsonNode ReadNode() + { + if (reader.Current.Kind == TokenKind.Eof || reader.Current.IsTerminator) + { + return null; + } + + switch (reader.Current.Kind) + { + case TokenKind.LeftBrace : return ReadObject(); // { + case TokenKind.LeftBracket : return ReadArray(); // [ + + default: throw new ParserException($"Expected '{{' or '['. Was {reader.Current}."); + } + } + + private JsonNode ReadFieldValue() + { + // Boolean, Date, Null, Number, String, Uri + if (reader.Current.IsLiteral) + { + return ReadLiteral(); + } + else + { + switch (reader.Current.Kind) + { + case TokenKind.LeftBracket: return ReadArray(); + case TokenKind.LeftBrace : return ReadObject(); + + default: throw new ParserException($"Unexpected token reading field value. Was {reader.Current}."); + } + } + } + + private JsonNode ReadLiteral() + { + var literal = reader.Current; + + reader.Next(); // Read the literal token + + switch (literal.Kind) + { + case TokenKind.Boolean : return JsonBoolean.Parse(literal.Value); + case TokenKind.Null : return XNull.Instance; + case TokenKind.Number : return new JsonNumber(literal.Value); + case TokenKind.String : return new JsonString(literal.Value); + + default: throw new ParserException($"Unexpected token reading literal. Was {literal}."); + } + } + + internal JsonObject ReadObject() + { + reader.Ensure(TokenKind.LeftBrace, "object"); + + reader.Next(); // Read '{' (Object start) + + var jsonObject = new JsonObject(); + + // Read the object's fields until we reach the end of the object ('}') + while (reader.Current.Kind != TokenKind.RightBrace) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read ',' (Seperator) + } + + // Ensure we have a field name + reader.Ensure(TokenKind.String, "Expected field name"); + + var field = ReadField(); + + jsonObject.Add(field.Key, field.Value); + } + + reader.Next(); // Read '}' (Object end) + + return jsonObject; + } + + + // TODO: Use ValueTuple in C#7 + private KeyValuePair ReadField() + { + var fieldName = reader.Current.Value; + + reader.Next(); // Read the field name + + reader.Ensure(TokenKind.Colon, "field"); + + reader.Next(); // Read ':' (Field value indicator) + + return new KeyValuePair(fieldName, ReadFieldValue()); + } + + + internal JsonArray ReadArray() + { + reader.Ensure(TokenKind.LeftBracket, "array"); + + var array = new XNodeArray(); + + reader.Next(); // Read the '[' (Array start) + + // Read the array's items + while (reader.Current.Kind != TokenKind.RightBracket) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read the ',' (Seperator) + } + + if (reader.Current.IsLiteral) + { + array.Add(ReadLiteral()); // Boolean, Date, Number, Null, String, Uri + } + else if (reader.Current.Kind == TokenKind.LeftBracket) + { + array.Add(ReadArray()); // Array + } + else if (reader.Current.Kind == TokenKind.LeftBrace) + { + array.Add(ReadObject()); // Object + } + else + { + throw new ParserException($"Expected comma, literal, or object. Was {reader.Current}."); + } + } + + reader.Next(); // Read the ']' (Array end) + + return array; + } + + #region IDisposable + + public void Dispose() + { + reader.Dispose(); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Parser/JsonToken.cs b/swaggerci/storSimple1200Series/generated/runtime/Parser/JsonToken.cs new file mode 100644 index 000000000000..b401220e0f92 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Parser/JsonToken.cs @@ -0,0 +1,66 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal enum TokenKind + { + LeftBrace, // { Object start + RightBrace, // } Object end + + LeftBracket, // [ Array start + RightBracket, // ] Array end + + Comma, // , Comma + Colon, // : Value indicator + Dot, // . Access field indicator + Terminator, // \0 Stream terminator + + Boolean = 31, // true or false + Null = 33, // null + Number = 34, // i.e. -1.93, -1, 0, 1, 1.1 + String = 35, // i.e. "text" + + Eof = 50 + } + + internal /* readonly */ struct JsonToken + { + internal static readonly JsonToken BraceOpen = new JsonToken(TokenKind.LeftBrace, "{"); + internal static readonly JsonToken BraceClose = new JsonToken(TokenKind.RightBrace, "}"); + + internal static readonly JsonToken BracketOpen = new JsonToken(TokenKind.LeftBracket, "["); + internal static readonly JsonToken BracketClose = new JsonToken(TokenKind.RightBracket, "]"); + + internal static readonly JsonToken Colon = new JsonToken(TokenKind.Colon, ":"); + internal static readonly JsonToken Comma = new JsonToken(TokenKind.Comma, ","); + internal static readonly JsonToken Terminator = new JsonToken(TokenKind.Terminator, "\0"); + + internal static readonly JsonToken True = new JsonToken(TokenKind.Boolean, "true"); + internal static readonly JsonToken False = new JsonToken(TokenKind.Boolean, "false"); + internal static readonly JsonToken Null = new JsonToken(TokenKind.Null, "null"); + + internal static readonly JsonToken Eof = new JsonToken(TokenKind.Eof, null); + + internal JsonToken(TokenKind kind, string value) + { + Kind = kind; + Value = value; + } + + internal readonly TokenKind Kind; + + internal readonly string Value; + + public override string ToString() => Kind + ": " + Value; + + #region Helpers + + internal bool IsLiteral => (byte)Kind > 30 && (byte)Kind < 40; + + internal bool IsTerminator => Kind == TokenKind.Terminator; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Parser/JsonTokenizer.cs b/swaggerci/storSimple1200Series/generated/runtime/Parser/JsonTokenizer.cs new file mode 100644 index 000000000000..2012e273cd87 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Parser/JsonTokenizer.cs @@ -0,0 +1,177 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + using System.IO; + + + public class JsonTokenizer : IDisposable + { + private readonly StringBuilder sb = new StringBuilder(); + + private readonly SourceReader reader; + + internal JsonTokenizer(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonTokenizer(SourceReader reader) + { + this.reader = reader; + + reader.Next(); // Start with the first char + } + + internal JsonToken ReadNext() + { + reader.SkipWhitespace(); + + if (reader.IsEof) return JsonToken.Eof; + + switch (reader.Current) + { + case '"': return ReadQuotedString(); + + // Symbols + case '[' : reader.Next(); return JsonToken.BracketOpen; // Array start + case ']' : reader.Next(); return JsonToken.BracketClose; // Array end + case ',' : reader.Next(); return JsonToken.Comma; // Value seperator + case ':' : reader.Next(); return JsonToken.Colon; // Field value indicator + case '{' : reader.Next(); return JsonToken.BraceOpen; // Object start + case '}' : reader.Next(); return JsonToken.BraceClose; // Object end + case '\0' : reader.Next(); return JsonToken.Terminator; // Stream terminiator + + default: return ReadLiteral(); + } + } + + private JsonToken ReadQuotedString() + { + Expect('"', "quoted string indicator"); + + reader.Next(); // Read '"' (Starting quote) + + // Read until we reach an unescaped quote char + while (reader.Current != '"') + { + EnsureNotEof("quoted string"); + + if (reader.Current == '\\') + { + char escapedCharacter = reader.ReadEscapeCode(); + + sb.Append(escapedCharacter); + + continue; + } + + StoreCurrentCharacterAndReadNext(); + } + + reader.Next(); // Read '"' (Ending quote) + + return new JsonToken(TokenKind.String, value: sb.Extract()); + } + + private JsonToken ReadLiteral() + { + if (char.IsDigit(reader.Current) || + reader.Current == '-' || + reader.Current == '+') + { + return ReadNumber(); + } + + return ReadIdentifer(); + } + + private JsonToken ReadNumber() + { + // Read until we hit a non-numeric character + // -6.247737e-06 + // E + + while (char.IsDigit(reader.Current) + || reader.Current == '.' + || reader.Current == 'e' + || reader.Current == 'E' + || reader.Current == '-' + || reader.Current == '+') + { + StoreCurrentCharacterAndReadNext(); + } + + return new JsonToken(TokenKind.Number, value: sb.Extract()); + } + + int count = 0; + + private JsonToken ReadIdentifer() + { + count++; + + if (!char.IsLetter(reader.Current)) + { + throw new ParserException( + message : $"Expected literal (number, boolean, or null). Was '{reader.Current}'.", + location : reader.Location + ); + } + + // Read letters, numbers, and underscores '_' + while (char.IsLetterOrDigit(reader.Current) || reader.Current == '_') + { + StoreCurrentCharacterAndReadNext(); + } + + string text = sb.Extract(); + + switch (text) + { + case "true": return JsonToken.True; + case "false": return JsonToken.False; + case "null": return JsonToken.Null; + + default: return new JsonToken(TokenKind.String, text); + } + } + + private void Expect(char character, string description) + { + if (reader.Current != character) + { + throw new ParserException( + message: $"Expected {description} ('{character}'). Was '{reader.Current}'.", + location: reader.Location + ); + } + } + + private void EnsureNotEof(string tokenType) + { + if (reader.IsEof) + { + throw new ParserException( + message: $"Unexpected EOF while reading {tokenType}.", + location: reader.Location + ); + } + } + + private void StoreCurrentCharacterAndReadNext() + { + sb.Append(reader.Current); + + reader.Next(); + } + + public void Dispose() + { + reader.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Parser/Location.cs b/swaggerci/storSimple1200Series/generated/runtime/Parser/Location.cs new file mode 100644 index 000000000000..95cb452a134a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Parser/Location.cs @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal struct SourceLocation + { + private int line; + private int column; + private int position; + + internal SourceLocation(int line = 0, int column = 0, int position = 0) + { + this.line = line; + this.column = column; + this.position = position; + } + + internal int Line => line; + + internal int Column => column; + + internal int Position => position; + + internal void Advance() + { + this.column++; + this.position++; + } + + internal void MarkNewLine() + { + this.line++; + this.column = 0; + } + + internal SourceLocation Clone() + { + return new SourceLocation(line, column, position); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Parser/Readers/SourceReader.cs b/swaggerci/storSimple1200Series/generated/runtime/Parser/Readers/SourceReader.cs new file mode 100644 index 000000000000..c060464510d9 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Parser/Readers/SourceReader.cs @@ -0,0 +1,130 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Globalization; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public sealed class SourceReader : IDisposable + { + private readonly TextReader source; + + private char current; + + private readonly SourceLocation location = new SourceLocation(); + + private bool isEof = false; + + internal SourceReader(TextReader textReader) + { + this.source = textReader ?? throw new ArgumentNullException(nameof(textReader)); + } + + /// + /// Advances to the next character + /// + internal void Next() + { + // Advance to the new line when we see a new line '\n'. + // A new line may be prefixed by a carriage return '\r'. + + if (current == '\n') + { + location.MarkNewLine(); + } + + int charCode = source.Read(); // -1 for end + + if (charCode >= 0) + { + current = (char)charCode; + } + else + { + // If we've already marked this as the EOF, throw an exception + if (isEof) + { + throw new EndOfStreamException("Cannot advance past end of stream."); + } + + isEof = true; + + current = '\0'; + } + + location.Advance(); + } + + internal void SkipWhitespace() + { + while (char.IsWhiteSpace(current)) + { + Next(); + } + } + + internal char ReadEscapeCode() + { + Next(); + + char escapedChar = current; + + Next(); // Consume escaped character + + switch (escapedChar) + { + // Special escape codes + case '"': return '"'; // " (Quotation mark) U+0022 + case '/': return '/'; // / (Solidus) U+002F + case '\\': return '\\'; // \ (Reverse solidus) U+005C + + // Control Characters + case '0': return '\0'; // Nul (0) U+0000 + case 'a': return '\a'; // Alert (7) + case 'b': return '\b'; // Backspace (8) U+0008 + case 'f': return '\f'; // Form feed (12) U+000C + case 'n': return '\n'; // Line feed (10) U+000A + case 'r': return '\r'; // Carriage return (13) U+000D + case 't': return '\t'; // Horizontal tab (9) U+0009 + case 'v': return '\v'; // Vertical tab + + // Unicode escape sequence + case 'u': return ReadUnicodeEscapeSequence(); // U+XXXX + + default: throw new Exception($"Unrecognized escape sequence '\\{escapedChar}'"); + } + } + + private readonly char[] hexCode = new char[4]; + + private char ReadUnicodeEscapeSequence() + { + hexCode[0] = current; Next(); + hexCode[1] = current; Next(); + hexCode[2] = current; Next(); + hexCode[3] = current; Next(); + + return Convert.ToChar(int.Parse( + s : new string(hexCode), + style : NumberStyles.HexNumber, + provider: NumberFormatInfo.InvariantInfo + )); + } + + internal char Current => current; + + internal bool IsEof => isEof; + + internal char Peek() => (char)source.Peek(); + + internal SourceLocation Location => location; + + public void Dispose() + { + source.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Parser/TokenReader.cs b/swaggerci/storSimple1200Series/generated/runtime/Parser/TokenReader.cs new file mode 100644 index 000000000000..b5cc000121d7 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Parser/TokenReader.cs @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + public class TokenReader : IDisposable + { + private readonly JsonTokenizer tokenizer; + private JsonToken current; + + internal TokenReader(JsonTokenizer tokenizer) + { + this.tokenizer = tokenizer ?? throw new ArgumentNullException(nameof(tokenizer)); + } + + internal void Next() + { + current = tokenizer.ReadNext(); + } + + internal JsonToken Current => current; + + internal void Ensure(TokenKind kind, string readerName) + { + if (current.Kind != kind) + { + throw new ParserException($"Expected {kind} while reading {readerName}). Was {current}."); + } + } + + public void Dispose() + { + tokenizer.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/PipelineMocking.cs b/swaggerci/storSimple1200Series/generated/runtime/PipelineMocking.cs new file mode 100644 index 000000000000..7ae7e073ebfc --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/PipelineMocking.cs @@ -0,0 +1,262 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + using System.Threading.Tasks; + using System.Collections.Generic; + using System.Net.Http; + using System.Linq; + using System.Net; + using Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json; + + public enum MockMode + { + Live, + Record, + Playback, + + } + + public class PipelineMock + { + + private System.Collections.Generic.Stack scenario = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack context = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack description = new System.Collections.Generic.Stack(); + + private readonly string recordingPath; + private int counter = 0; + + public static implicit operator Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.SendAsyncStep(PipelineMock instance) => instance.SendAsync; + + public MockMode Mode { get; set; } = MockMode.Live; + public PipelineMock(string recordingPath) + { + this.recordingPath = recordingPath; + } + + public void PushContext(string text) => context.Push(text); + + public void PushDescription(string text) => description.Push(text); + + + public void PushScenario(string it) + { + // reset counter too + counter = 0; + + scenario.Push(it); + } + + public void PopContext() => context.Pop(); + + public void PopDescription() => description.Pop(); + + public void PopScenario() => scenario.Pop(); + + public void SetRecord() => Mode = MockMode.Record; + + public void SetPlayback() => Mode = MockMode.Playback; + + public void SetLive() => Mode = MockMode.Live; + + public string Scenario => (scenario.Count > 0 ? scenario.Peek() : "[NoScenario]"); + public string Description => (description.Count > 0 ? description.Peek() : "[NoDescription]"); + public string Context => (context.Count > 0 ? context.Peek() : "[NoContext]"); + + /// + /// Headers that we substitute out blank values for in the recordings + /// Add additional headers as necessary + /// + public static HashSet Blacklist = new HashSet(System.StringComparer.CurrentCultureIgnoreCase) { + "Authorization", + }; + + public Dictionary ForceResponseHeaders = new Dictionary(); + + internal static XImmutableArray Removed = new XImmutableArray(new string[] { "[Filtered]" }); + + internal static IEnumerable> FilterHeaders(IEnumerable>> headers) => headers.Select(header => new KeyValuePair(header.Key, Blacklist.Contains(header.Key) ? Removed : new XImmutableArray(header.Value.ToArray()))); + + internal static JsonNode SerializeContent(HttpContent content, ref bool isBase64) => content == null ? XNull.Instance : SerializeContent(content.ReadAsByteArrayAsync().Result, ref isBase64); + + internal static JsonNode SerializeContent(byte[] content, ref bool isBase64) + { + if (null == content || content.Length == 0) + { + return XNull.Instance; + } + var first = content[0]; + var last = content[content.Length - 1]; + + // plaintext for JSON/SGML/XML/HTML/STRINGS/ARRAYS + if ((first == '{' && last == '}') || (first == '<' && last == '>') || (first == '[' && last == ']') || (first == '"' && last == '"')) + { + return new JsonString(System.Text.Encoding.UTF8.GetString(content)); + } + + // base64 for everyone else + return new JsonString(System.Convert.ToBase64String(content)); + } + + internal static byte[] DeserializeContent(string content, bool isBase64) + { + if (string.IsNullOrWhiteSpace(content)) + { + return new byte[0]; + } + + if (isBase64) + { + try + { + return System.Convert.FromBase64String(content); + } + catch + { + // hmm. didn't work, return it as a string I guess. + } + } + return System.Text.Encoding.UTF8.GetBytes(content); + } + + public void SaveMessage(string rqKey, HttpRequestMessage request, HttpResponseMessage response) + { + var messages = System.IO.File.Exists(this.recordingPath) ? Load() : new JsonObject() ?? new JsonObject(); + bool isBase64Request = false; + bool isBase64Response = false; + messages[rqKey] = new JsonObject { + { "Request",new JsonObject { + { "Method", request.Method.Method }, + { "RequestUri", request.RequestUri }, + { "Content", SerializeContent( request.Content, ref isBase64Request) }, + { "isContentBase64", isBase64Request }, + { "Headers", new JsonObject(FilterHeaders(request.Headers)) }, + { "ContentHeaders", request.Content == null ? new JsonObject() : new JsonObject(FilterHeaders(request.Content.Headers))} + } }, + {"Response", new JsonObject { + { "StatusCode", (int)response.StatusCode}, + { "Headers", new JsonObject(FilterHeaders(response.Headers))}, + { "ContentHeaders", new JsonObject(FilterHeaders(response.Content.Headers))}, + { "Content", SerializeContent(response.Content, ref isBase64Response) }, + { "isContentBase64", isBase64Response }, + }} + }; + System.IO.File.WriteAllText(this.recordingPath, messages.ToString()); + } + + private JsonObject Load() + { + if (System.IO.File.Exists(this.recordingPath)) + { + try + { + return JsonObject.FromStream(System.IO.File.OpenRead(this.recordingPath)); + } + catch + { + throw new System.Exception($"Invalid recording file: '{recordingPath}'"); + } + } + + throw new System.ArgumentException($"Missing recording file: '{recordingPath}'", nameof(recordingPath)); + } + + public HttpResponseMessage LoadMessage(string rqKey) + { + var responses = Load(); + var message = responses.Property(rqKey); + + if (null == message) + { + throw new System.ArgumentException($"Missing Request '{rqKey}' in recording file", nameof(rqKey)); + } + + var sc = 0; + var reqMessage = message.Property("Request"); + var respMessage = message.Property("Response"); + + // --------------------------- deserialize response ---------------------------------------------------------------- + bool isBase64Response = false; + respMessage.BooleanProperty("isContentBase64", ref isBase64Response); + var response = new HttpResponseMessage + { + StatusCode = (HttpStatusCode)respMessage.NumberProperty("StatusCode", ref sc), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(respMessage.StringProperty("Content"), isBase64Response)) + }; + + foreach (var each in respMessage.Property("Headers")) + { + response.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + foreach (var frh in ForceResponseHeaders) + { + response.Headers.Remove(frh.Key); + response.Headers.TryAddWithoutValidation(frh.Key, frh.Value); + } + + foreach (var each in respMessage.Property("ContentHeaders")) + { + response.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + // --------------------------- deserialize request ---------------------------------------------------------------- + bool isBase64Request = false; + reqMessage.BooleanProperty("isContentBase64", ref isBase64Request); + response.RequestMessage = new HttpRequestMessage + { + Method = new HttpMethod(reqMessage.StringProperty("Method")), + RequestUri = new System.Uri(reqMessage.StringProperty("RequestUri")), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(reqMessage.StringProperty("Content"), isBase64Request)) + }; + + foreach (var each in reqMessage.Property("Headers")) + { + response.RequestMessage.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + foreach (var each in reqMessage.Property("ContentHeaders")) + { + response.RequestMessage.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + return response; + } + + public async Task SendAsync(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + counter++; + var rqkey = $"{Description}+{Context}+{Scenario}+${request.Method.Method}+{request.RequestUri}+{counter}"; + + switch (Mode) + { + case MockMode.Record: + //Add following code since the request.Content will be released after sendAsync + var requestClone = request; + if (requestClone.Content != null) + { + requestClone = await request.CloneWithContent(request.RequestUri, request.Method); + } + // make the call + var response = await next.SendAsync(request, callback); + + // save the message to the recording file + SaveMessage(rqkey, requestClone, response); + + // return the response. + return response; + + case MockMode.Playback: + // load and return the response. + return LoadMessage(rqkey); + + default: + // pass-thru, do nothing + return await next.SendAsync(request, callback); + } + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/Properties/Resources.Designer.cs b/swaggerci/storSimple1200Series/generated/runtime/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..d5c38dba962c --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Properties/Resources.Designer.cs @@ -0,0 +1,5633 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.generated.runtime.Properties +{ + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.PowerShell.Cmdlets.StorSimple.generated.runtime.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to The remote server returned an error: (401) Unauthorized.. + /// + public static string AccessDeniedExceptionMessage + { + get + { + return ResourceManager.GetString("AccessDeniedExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account id doesn't match one in subscription.. + /// + public static string AccountIdDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("AccountIdDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account needs to be specified. + /// + public static string AccountNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("AccountNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account "{0}" has been added.. + /// + public static string AddAccountAdded + { + get + { + return ResourceManager.GetString("AddAccountAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To switch to a different subscription, please use Select-AzureSubscription.. + /// + public static string AddAccountChangeSubscription + { + get + { + return ResourceManager.GetString("AddAccountChangeSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential".. + /// + public static string AddAccountNonInteractiveGuestOrFpo + { + get + { + return ResourceManager.GetString("AddAccountNonInteractiveGuestOrFpo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription "{0}" is selected as the default subscription.. + /// + public static string AddAccountShowDefaultSubscription + { + get + { + return ResourceManager.GetString("AddAccountShowDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To view all the subscriptions, please use Get-AzureSubscription.. + /// + public static string AddAccountViewSubscriptions + { + get + { + return ResourceManager.GetString("AddAccountViewSubscriptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is created successfully.. + /// + public static string AddOnCreatedMessage + { + get + { + return ResourceManager.GetString("AddOnCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on name {0} is already used.. + /// + public static string AddOnNameAlreadyUsed + { + get + { + return ResourceManager.GetString("AddOnNameAlreadyUsed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} not found.. + /// + public static string AddOnNotFound + { + get + { + return ResourceManager.GetString("AddOnNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on {0} is removed successfully.. + /// + public static string AddOnRemovedMessage + { + get + { + return ResourceManager.GetString("AddOnRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is updated successfully.. + /// + public static string AddOnUpdatedMessage + { + get + { + return ResourceManager.GetString("AddOnUpdatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}.. + /// + public static string AddRoleMessageCreate + { + get + { + return ResourceManager.GetString("AddRoleMessageCreate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’.. + /// + public static string AddRoleMessageCreateNode + { + get + { + return ResourceManager.GetString("AddRoleMessageCreateNode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure".. + /// + public static string AddRoleMessageCreatePHP + { + get + { + return ResourceManager.GetString("AddRoleMessageCreatePHP", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator. + /// + public static string AddRoleMessageInsufficientPermissions + { + get + { + return ResourceManager.GetString("AddRoleMessageInsufficientPermissions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A role name '{0}' already exists. + /// + public static string AddRoleMessageRoleExists + { + get + { + return ResourceManager.GetString("AddRoleMessageRoleExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} already has an endpoint with name {1}. + /// + public static string AddTrafficManagerEndpointFailed + { + get + { + return ResourceManager.GetString("AddTrafficManagerEndpointFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. + ///Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable [rest of string was truncated]";. + /// + public static string ARMDataCollectionMessage + { + get + { + return ResourceManager.GetString("ARMDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [Common.Authentication]: Authenticating for account {0} with single tenant {1}.. + /// + public static string AuthenticatingForSingleTenant + { + get + { + return ResourceManager.GetString("AuthenticatingForSingleTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Windows Azure Powershell\. + /// + public static string AzureDirectory + { + get + { + return ResourceManager.GetString("AzureDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://manage.windowsazure.com. + /// + public static string AzurePortalUrl + { + get + { + return ResourceManager.GetString("AzurePortalUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PORTAL_URL. + /// + public static string AzurePortalUrlEnv + { + get + { + return ResourceManager.GetString("AzurePortalUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selected profile must not be null.. + /// + public static string AzureProfileMustNotBeNull + { + get + { + return ResourceManager.GetString("AzureProfileMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure SDK\{0}\. + /// + public static string AzureSdkDirectory + { + get + { + return ResourceManager.GetString("AzureSdkDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscArchiveAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscArchiveAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find configuration data file: {0}. + /// + public static string AzureVMDscCannotFindConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscCannotFindConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Create Archive. + /// + public static string AzureVMDscCreateArchiveAction + { + get + { + return ResourceManager.GetString("AzureVMDscCreateArchiveAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The configuration data must be a .psd1 file. + /// + public static string AzureVMDscInvalidConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscInvalidConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parsing configuration script: {0}. + /// + public static string AzureVMDscParsingConfiguration + { + get + { + return ResourceManager.GetString("AzureVMDscParsingConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscStorageBlobAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscStorageBlobAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upload '{0}'. + /// + public static string AzureVMDscUploadToBlobStorageAction + { + get + { + return ResourceManager.GetString("AzureVMDscUploadToBlobStorageAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Execution failed because a background thread could not prompt the user.. + /// + public static string BaseShouldMethodFailureReason + { + get + { + return ResourceManager.GetString("BaseShouldMethodFailureReason", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Base Uri was empty.. + /// + public static string BaseUriEmpty + { + get + { + return ResourceManager.GetString("BaseUriEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing without ParameterSet.. + /// + public static string BeginProcessingWithoutParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithoutParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing with ParameterSet '{1}'.. + /// + public static string BeginProcessingWithParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Blob with the name {0} already exists in the account.. + /// + public static string BlobAlreadyExistsInTheAccount + { + get + { + return ResourceManager.GetString("BlobAlreadyExistsInTheAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}.blob.core.windows.net/. + /// + public static string BlobEndpointUri + { + get + { + return ResourceManager.GetString("BlobEndpointUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_BLOBSTORAGE_TEMPLATE. + /// + public static string BlobEndpointUriEnv + { + get + { + return ResourceManager.GetString("BlobEndpointUriEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is changing.. + /// + public static string BreakingChangeAttributeParameterChanging + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterChanging", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is becoming mandatory.. + /// + public static string BreakingChangeAttributeParameterMandatoryNow + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterMandatoryNow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplaced + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplaced", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by mandatory parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplacedMandatory + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplacedMandatory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type of the parameter is changing from '{0}' to '{1}'.. + /// + public static string BreakingChangeAttributeParameterTypeChange + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterTypeChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change description : {0} + ///. + /// + public static string BreakingChangesAttributesChangeDescriptionMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesChangeDescriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet '{0}' is replacing this cmdlet.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type is changing from the existing type :'{0}' to the new type :'{1}'. + /// + public static string BreakingChangesAttributesCmdLetOutputChange1 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "The output type '{0}' is changing". + /// + public static string BreakingChangesAttributesCmdLetOutputChange2 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + ///- The following properties are being added to the output type : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesAdded + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + /// - The following properties in the output type are being deprecated : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesRemoved + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesRemoved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type '{0}' is being deprecated without a replacement.. + /// + public static string BreakingChangesAttributesCmdLetOutputTypeDeprecated + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputTypeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - {0} + /// + ///. + /// + public static string BreakingChangesAttributesDeclarationMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - Cmdlet : '{0}' + /// - {1} + ///. + /// + public static string BreakingChangesAttributesDeclarationMessageWithCmdletName + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessageWithCmdletName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to NOTE : Go to {0} for steps to suppress (and other related information on) the breaking change messages.. + /// + public static string BreakingChangesAttributesFooterMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesFooterMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Breaking changes in the cmdlet '{0}' :. + /// + public static string BreakingChangesAttributesHeaderMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesHeaderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note : This change will take effect on '{0}' + ///. + /// + public static string BreakingChangesAttributesInEffectByDateMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByDateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note :The change is expected to take effect from the version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ```powershell + ///# Old + ///{0} + /// + ///# New + ///{1} + ///``` + /// + ///. + /// + public static string BreakingChangesAttributesUsageChangeMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cmdlet invocation changes : + /// Old Way : {0} + /// New Way : {1}. + /// + public static string BreakingChangesAttributesUsageChangeMessageConsole + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessageConsole", resourceCulture); + } + } + + /// + /// The cmdlet is in experimental stage. The function may not be enabled in current subscription. + /// + public static string ExperimentalCmdletMessage + { + get + { + return ResourceManager.GetString("ExperimentalCmdletMessage", resourceCulture); + } + } + + + + /// + /// Looks up a localized string similar to CACHERUNTIMEURL. + /// + public static string CacheRuntimeUrl + { + get + { + return ResourceManager.GetString("CacheRuntimeUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cache. + /// + public static string CacheRuntimeValue + { + get + { + return ResourceManager.GetString("CacheRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CacheRuntimeVersion. + /// + public static string CacheRuntimeVersionKey + { + get + { + return ResourceManager.GetString("CacheRuntimeVersionKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}). + /// + public static string CacheVersionWarningText + { + get + { + return ResourceManager.GetString("CacheVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot change built-in environment {0}.. + /// + public static string CannotChangeBuiltinEnvironment + { + get + { + return ResourceManager.GetString("CannotChangeBuiltinEnvironment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find {0} with name {1}.. + /// + public static string CannotFind + { + get + { + return ResourceManager.GetString("CannotFind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment for service {0} with {1} slot doesn't exist. + /// + public static string CannotFindDeployment + { + get + { + return ResourceManager.GetString("CannotFindDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can't find valid Microsoft Azure role in current directory {0}. + /// + public static string CannotFindRole + { + get + { + return ResourceManager.GetString("CannotFindRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist. + /// + public static string CannotFindServiceConfigurationFile + { + get + { + return ResourceManager.GetString("CannotFindServiceConfigurationFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders.. + /// + public static string CannotFindServiceRoot + { + get + { + return ResourceManager.GetString("CannotFindServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated.. + /// + public static string CannotUpdateUnknownSubscription + { + get + { + return ResourceManager.GetString("CannotUpdateUnknownSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ManagementCertificate. + /// + public static string CertificateElementName + { + get + { + return ResourceManager.GetString("CertificateElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to certificate.pfx. + /// + public static string CertificateFileName + { + get + { + return ResourceManager.GetString("CertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate imported into CurrentUser\My\{0}. + /// + public static string CertificateImportedMessage + { + get + { + return ResourceManager.GetString("CertificateImportedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No certificate was found in the certificate store with thumbprint {0}. + /// + public static string CertificateNotFoundInStore + { + get + { + return ResourceManager.GetString("CertificateNotFoundInStore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your account does not have access to the private key for certificate {0}. + /// + public static string CertificatePrivateKeyAccessError + { + get + { + return ResourceManager.GetString("CertificatePrivateKeyAccessError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} {1} deployment for {2} service. + /// + public static string ChangeDeploymentStateWaitMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStateWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cloud service {0} is in {1} state.. + /// + public static string ChangeDeploymentStatusCompleteMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStatusCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing/Removing public environment '{0}' is not allowed.. + /// + public static string ChangePublicEnvironmentMessage + { + get + { + return ResourceManager.GetString("ChangePublicEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} is set to value {1}. + /// + public static string ChangeSettingsElementMessage + { + get + { + return ResourceManager.GetString("ChangeSettingsElementMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing public environment is not supported.. + /// + public static string ChangingDefaultEnvironmentNotSupported + { + get + { + return ResourceManager.GetString("ChangingDefaultEnvironmentNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Choose which publish settings file to use:. + /// + public static string ChoosePublishSettingsFile + { + get + { + return ResourceManager.GetString("ChoosePublishSettingsFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel. + /// + public static string ClientDiagnosticLevelName + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string ClientDiagnosticLevelValue + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cloud_package.cspkg. + /// + public static string CloudPackageFileName + { + get + { + return ResourceManager.GetString("CloudPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Cloud.cscfg. + /// + public static string CloudServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("CloudServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-ons for {0}. + /// + public static string CloudServiceDescription + { + get + { + return ResourceManager.GetString("CloudServiceDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive.. + /// + public static string CommunicationCouldNotBeEstablished + { + get + { + return ResourceManager.GetString("CommunicationCouldNotBeEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete. + /// + public static string CompleteMessage + { + get + { + return ResourceManager.GetString("CompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OperationID : '{0}'. + /// + public static string ComputeCloudExceptionOperationIdMessage + { + get + { + return ResourceManager.GetString("ComputeCloudExceptionOperationIdMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to config.json. + /// + public static string ConfigurationFileName + { + get + { + return ResourceManager.GetString("ConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to VirtualMachine creation failed.. + /// + public static string CreateFailedErrorMessage + { + get + { + return ResourceManager.GetString("CreateFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead.. + /// + public static string CreateWebsiteFailed + { + get + { + return ResourceManager.GetString("CreateWebsiteFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core. + /// + public static string DataCacheClientsType + { + get + { + return ResourceManager.GetString("DataCacheClientsType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //blobcontainer[@datacenter='{0}']. + /// + public static string DatacenterBlobQuery + { + get + { + return ResourceManager.GetString("DatacenterBlobQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure PowerShell Data Collection Confirmation. + /// + public static string DataCollectionActivity + { + get + { + return ResourceManager.GetString("DataCollectionActivity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose not to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmNo + { + get + { + return ResourceManager.GetString("DataCollectionConfirmNo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This confirmation message will be dismissed in '{0}' second(s).... + /// + public static string DataCollectionConfirmTime + { + get + { + return ResourceManager.GetString("DataCollectionConfirmTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmYes + { + get + { + return ResourceManager.GetString("DataCollectionConfirmYes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The setting profile has been saved to the following path '{0}'.. + /// + public static string DataCollectionSaveFileInformation + { + get + { + return ResourceManager.GetString("DataCollectionSaveFileInformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription. + /// + public static string DefaultAndCurrentSubscription + { + get + { + return ResourceManager.GetString("DefaultAndCurrentSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to none. + /// + public static string DefaultFileVersion + { + get + { + return ResourceManager.GetString("DefaultFileVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are no hostnames which could be used for validation.. + /// + public static string DefaultHostnamesValidation + { + get + { + return ResourceManager.GetString("DefaultHostnamesValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 8080. + /// + public static string DefaultPort + { + get + { + return ResourceManager.GetString("DefaultPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string DefaultRoleCachingInMB + { + get + { + return ResourceManager.GetString("DefaultRoleCachingInMB", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Auto. + /// + public static string DefaultUpgradeMode + { + get + { + return ResourceManager.GetString("DefaultUpgradeMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 80. + /// + public static string DefaultWebPort + { + get + { + return ResourceManager.GetString("DefaultWebPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delete. + /// + public static string Delete + { + get + { + return ResourceManager.GetString("Delete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for service {1} is already in {2} state. + /// + public static string DeploymentAlreadyInState + { + get + { + return ResourceManager.GetString("DeploymentAlreadyInState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment in {0} slot for service {1} is removed. + /// + public static string DeploymentRemovedMessage + { + get + { + return ResourceManager.GetString("DeploymentRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel. + /// + public static string DiagnosticLevelName + { + get + { + return ResourceManager.GetString("DiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string DiagnosticLevelValue + { + get + { + return ResourceManager.GetString("DiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key to add already exists in the dictionary.. + /// + public static string DictionaryAddAlreadyContainsKey + { + get + { + return ResourceManager.GetString("DictionaryAddAlreadyContainsKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The array index cannot be less than zero.. + /// + public static string DictionaryCopyToArrayIndexLessThanZero + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayIndexLessThanZero", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The supplied array does not have enough room to contain the copied elements.. + /// + public static string DictionaryCopyToArrayTooShort + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayTooShort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided dns {0} doesn't exist. + /// + public static string DnsDoesNotExist + { + get + { + return ResourceManager.GetString("DnsDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure Certificate. + /// + public static string EnableRemoteDesktop_FriendlyCertificateName + { + get + { + return ResourceManager.GetString("EnableRemoteDesktop_FriendlyCertificateName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Endpoint can't be retrieved for storage account. + /// + public static string EndPointNotFoundForBlobStorage + { + get + { + return ResourceManager.GetString("EndPointNotFoundForBlobStorage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} end processing.. + /// + public static string EndProcessingLog + { + get + { + return ResourceManager.GetString("EndProcessingLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet.. + /// + public static string EnvironmentDoesNotSupportActiveDirectory + { + get + { + return ResourceManager.GetString("EnvironmentDoesNotSupportActiveDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment '{0}' already exists.. + /// + public static string EnvironmentExists + { + get + { + return ResourceManager.GetString("EnvironmentExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name doesn't match one in subscription.. + /// + public static string EnvironmentNameDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("EnvironmentNameDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name needs to be specified.. + /// + public static string EnvironmentNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment needs to be specified.. + /// + public static string EnvironmentNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment name '{0}' is not found.. + /// + public static string EnvironmentNotFound + { + get + { + return ResourceManager.GetString("EnvironmentNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to environments.xml. + /// + public static string EnvironmentsFileName + { + get + { + return ResourceManager.GetString("EnvironmentsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error creating VirtualMachine. + /// + public static string ErrorCreatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorCreatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to download available runtimes for location '{0}'. + /// + public static string ErrorRetrievingRuntimesForLocation + { + get + { + return ResourceManager.GetString("ErrorRetrievingRuntimesForLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error updating VirtualMachine. + /// + public static string ErrorUpdatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorUpdatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} failed. Error: {1}, ExceptionDetails: {2}. + /// + public static string FailedJobErrorMessage + { + get + { + return ResourceManager.GetString("FailedJobErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File path is not valid.. + /// + public static string FilePathIsNotValid + { + get + { + return ResourceManager.GetString("FilePathIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HTTP request was forbidden with client authentication scheme 'Anonymous'.. + /// + public static string FirstPurchaseErrorMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell.. + /// + public static string FirstPurchaseMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation Status:. + /// + public static string GatewayOperationStatus + { + get + { + return ResourceManager.GetString("GatewayOperationStatus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\General. + /// + public static string GeneralScaffolding + { + get + { + return ResourceManager.GetString("GeneralScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting all available Microsoft Azure Add-Ons, this may take few minutes.... + /// + public static string GetAllAddOnsWaitMessage + { + get + { + return ResourceManager.GetString("GetAllAddOnsWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Name{0}Primary Key{0}Seconday Key. + /// + public static string GetStorageKeysHeader + { + get + { + return ResourceManager.GetString("GetStorageKeysHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Git not found. Please install git and place it in your command line path.. + /// + public static string GitNotFound + { + get + { + return ResourceManager.GetString("GitNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find publish settings. Please run Import-AzurePublishSettingsFile.. + /// + public static string GlobalSettingsManager_Load_PublishSettingsNotFound + { + get + { + return ResourceManager.GetString("GlobalSettingsManager_Load_PublishSettingsNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg end element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoEndWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoEndWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WadCfg start element in the config is not matching the end element.. + /// + public static string IaasDiagnosticsBadConfigNoMatchingWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoMatchingWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode.dll. + /// + public static string IISNodeDll + { + get + { + return ResourceManager.GetString("IISNodeDll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeEngineKey + { + get + { + return ResourceManager.GetString("IISNodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode-dev\\release\\x64. + /// + public static string IISNodePath + { + get + { + return ResourceManager.GetString("IISNodePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeRuntimeValue + { + get + { + return ResourceManager.GetString("IISNodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}). + /// + public static string IISNodeVersionWarningText + { + get + { + return ResourceManager.GetString("IISNodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Illegal characters in path.. + /// + public static string IllegalPath + { + get + { + return ResourceManager.GetString("IllegalPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. + /// + public static string InternalServerErrorMessage + { + get + { + return ResourceManager.GetString("InternalServerErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot enable memcach protocol on a cache worker role {0}.. + /// + public static string InvalidCacheRoleName + { + get + { + return ResourceManager.GetString("InvalidCacheRoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings. + /// + public static string InvalidCertificate + { + get + { + return ResourceManager.GetString("InvalidCertificate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format.. + /// + public static string InvalidCertificateSingle + { + get + { + return ResourceManager.GetString("InvalidCertificateSingle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided configuration path is invalid or doesn't exist. + /// + public static string InvalidConfigPath + { + get + { + return ResourceManager.GetString("InvalidConfigPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2.. + /// + public static string InvalidCountryNameMessage + { + get + { + return ResourceManager.GetString("InvalidCountryNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.. + /// + public static string InvalidDefaultSubscription + { + get + { + return ResourceManager.GetString("InvalidDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment with {0} does not exist. + /// + public static string InvalidDeployment + { + get + { + return ResourceManager.GetString("InvalidDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production".. + /// + public static string InvalidDeploymentSlot + { + get + { + return ResourceManager.GetString("InvalidDeploymentSlot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "{0}" is an invalid DNS name for {1}. + /// + public static string InvalidDnsName + { + get + { + return ResourceManager.GetString("InvalidDnsName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service endpoint.. + /// + public static string InvalidEndpoint + { + get + { + return ResourceManager.GetString("InvalidEndpoint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided file in {0} must be have {1} extension. + /// + public static string InvalidFileExtension + { + get + { + return ResourceManager.GetString("InvalidFileExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File {0} has invalid characters. + /// + public static string InvalidFileName + { + get + { + return ResourceManager.GetString("InvalidFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your git publishing credentials using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. On the left side open "Web Sites" + ///2. Click on any website + ///3. Choose "Setup Git Publishing" or "Reset deployment credentials" + ///4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username}. + /// + public static string InvalidGitCredentials + { + get + { + return ResourceManager.GetString("InvalidGitCredentials", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value {0} provided is not a valid GUID. Please provide a valid GUID.. + /// + public static string InvalidGuid + { + get + { + return ResourceManager.GetString("InvalidGuid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified hostname does not exist. Please specify a valid hostname for the site.. + /// + public static string InvalidHostnameValidation + { + get + { + return ResourceManager.GetString("InvalidHostnameValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances must be greater than or equal 0 and less than or equal 20. + /// + public static string InvalidInstancesCount + { + get + { + return ResourceManager.GetString("InvalidInstancesCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file.. + /// + public static string InvalidJobFile + { + get + { + return ResourceManager.GetString("InvalidJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not download a valid runtime manifest, Please check your internet connection and try again.. + /// + public static string InvalidManifestError + { + get + { + return ResourceManager.GetString("InvalidManifestError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The account {0} was not found. Please specify a valid account name.. + /// + public static string InvalidMediaServicesAccount + { + get + { + return ResourceManager.GetString("InvalidMediaServicesAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided name "{0}" does not match the service bus namespace naming rules.. + /// + public static string InvalidNamespaceName + { + get + { + return ResourceManager.GetString("InvalidNamespaceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path must specify a valid path to an Azure profile.. + /// + public static string InvalidNewProfilePath + { + get + { + return ResourceManager.GetString("InvalidNewProfilePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value cannot be null. Parameter name: '{0}'. + /// + public static string InvalidNullArgument + { + get + { + return ResourceManager.GetString("InvalidNullArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is invalid or empty. + /// + public static string InvalidOrEmptyArgumentMessage + { + get + { + return ResourceManager.GetString("InvalidOrEmptyArgumentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided package path is invalid or doesn't exist. + /// + public static string InvalidPackagePath + { + get + { + return ResourceManager.GetString("InvalidPackagePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is an invalid parameter set name.. + /// + public static string InvalidParameterSetName + { + get + { + return ResourceManager.GetString("InvalidParameterSetName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} doesn't exist in {1} or you've not passed valid value for it. + /// + public static string InvalidPath + { + get + { + return ResourceManager.GetString("InvalidPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} has invalid characters. + /// + public static string InvalidPathName + { + get + { + return ResourceManager.GetString("InvalidPathName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token}. + /// + public static string InvalidProfileProperties + { + get + { + return ResourceManager.GetString("InvalidProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile. + /// + public static string InvalidPublishSettingsSchema + { + get + { + return ResourceManager.GetString("InvalidPublishSettingsSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name "{0}" has invalid characters. + /// + public static string InvalidRoleNameMessage + { + get + { + return ResourceManager.GetString("InvalidRoleNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid name for the service root folder is required. + /// + public static string InvalidRootNameMessage + { + get + { + return ResourceManager.GetString("InvalidRootNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is not a recognized runtime type. + /// + public static string InvalidRuntimeError + { + get + { + return ResourceManager.GetString("InvalidRuntimeError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid language is required. + /// + public static string InvalidScaffoldingLanguageArg + { + get + { + return ResourceManager.GetString("InvalidScaffoldingLanguageArg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscription is currently selected. Use Select-Subscription to activate a subscription.. + /// + public static string InvalidSelectedSubscription + { + get + { + return ResourceManager.GetString("InvalidSelectedSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations.. + /// + public static string InvalidServiceBusLocation + { + get + { + return ResourceManager.GetString("InvalidServiceBusLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide a service name or run this command from inside a service project directory.. + /// + public static string InvalidServiceName + { + get + { + return ResourceManager.GetString("InvalidServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must provide valid value for {0}. + /// + public static string InvalidServiceSettingElement + { + get + { + return ResourceManager.GetString("InvalidServiceSettingElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to settings.json is invalid or doesn't exist. + /// + public static string InvalidServiceSettingMessage + { + get + { + return ResourceManager.GetString("InvalidServiceSettingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data.. + /// + public static string InvalidSubscription + { + get + { + return ResourceManager.GetString("InvalidSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscription id {0} is not valid. + /// + public static string InvalidSubscriptionId + { + get + { + return ResourceManager.GetString("InvalidSubscriptionId", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Must specify a non-null subscription name.. + /// + public static string InvalidSubscriptionName + { + get + { + return ResourceManager.GetString("InvalidSubscriptionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet. + /// + public static string InvalidSubscriptionNameMessage + { + get + { + return ResourceManager.GetString("InvalidSubscriptionNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscriptions file {0} has invalid content.. + /// + public static string InvalidSubscriptionsDataSchema + { + get + { + return ResourceManager.GetString("InvalidSubscriptionsDataSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge.. + /// + public static string InvalidVMSize + { + get + { + return ResourceManager.GetString("InvalidVMSize", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The web job file must have *.zip extension. + /// + public static string InvalidWebJobFile + { + get + { + return ResourceManager.GetString("InvalidWebJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Singleton option works for continuous jobs only.. + /// + public static string InvalidWebJobSingleton + { + get + { + return ResourceManager.GetString("InvalidWebJobSingleton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The website {0} was not found. Please specify a valid website name.. + /// + public static string InvalidWebsite + { + get + { + return ResourceManager.GetString("InvalidWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No job for id: {0} was found.. + /// + public static string JobNotFound + { + get + { + return ResourceManager.GetString("JobNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to engines. + /// + public static string JsonEnginesSectionName + { + get + { + return ResourceManager.GetString("JsonEnginesSectionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scaffolding for this language is not yet supported. + /// + public static string LanguageScaffoldingIsNotSupported + { + get + { + return ResourceManager.GetString("LanguageScaffoldingIsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Link already established. + /// + public static string LinkAlreadyEstablished + { + get + { + return ResourceManager.GetString("LinkAlreadyEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to local_package.csx. + /// + public static string LocalPackageFileName + { + get + { + return ResourceManager.GetString("LocalPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Local.cscfg. + /// + public static string LocalServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("LocalServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for {0} deployment for {1} cloud service.... + /// + public static string LookingForDeploymentMessage + { + get + { + return ResourceManager.GetString("LookingForDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for cloud service {0}.... + /// + public static string LookingForServiceMessage + { + get + { + return ResourceManager.GetString("LookingForServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure Long-Running Job. + /// + public static string LROJobName + { + get + { + return ResourceManager.GetString("LROJobName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter.. + /// + public static string LROTaskExceptionMessage + { + get + { + return ResourceManager.GetString("LROTaskExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to managementCertificate.pem. + /// + public static string ManagementCertificateFileName + { + get + { + return ResourceManager.GetString("ManagementCertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ?whr={0}. + /// + public static string ManagementPortalRealmFormat + { + get + { + return ResourceManager.GetString("ManagementPortalRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //baseuri. + /// + public static string ManifestBaseUriQuery + { + get + { + return ResourceManager.GetString("ManifestBaseUriQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uri. + /// + public static string ManifestBlobUriKey + { + get + { + return ResourceManager.GetString("ManifestBlobUriKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml. + /// + public static string ManifestUri + { + get + { + return ResourceManager.GetString("ManifestUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'.. + /// + public static string MissingCertificateInProfileProperties + { + get + { + return ResourceManager.GetString("MissingCertificateInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'.. + /// + public static string MissingPasswordInProfileProperties + { + get + { + return ResourceManager.GetString("MissingPasswordInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'SubscriptionId'.. + /// + public static string MissingSubscriptionInProfileProperties + { + get + { + return ResourceManager.GetString("MissingSubscriptionInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple Add-Ons found holding name {0}. + /// + public static string MultipleAddOnsFoundMessage + { + get + { + return ResourceManager.GetString("MultipleAddOnsFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername.. + /// + public static string MultiplePublishingUsernames + { + get + { + return ResourceManager.GetString("MultiplePublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The first publish settings file "{0}" is used. If you want to use another file specify the file name.. + /// + public static string MultiplePublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("MultiplePublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.NamedCaches. + /// + public static string NamedCacheSettingName + { + get + { + return ResourceManager.GetString("NamedCacheSettingName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]}. + /// + public static string NamedCacheSettingValue + { + get + { + return ResourceManager.GetString("NamedCacheSettingValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A publishing username is required. Please specify one using the argument PublishingUsername.. + /// + public static string NeedPublishingUsernames + { + get + { + return ResourceManager.GetString("NeedPublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Add-On Confirmation. + /// + public static string NewAddOnConformation + { + get + { + return ResourceManager.GetString("NewAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string NewMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names.. + /// + public static string NewNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("NewNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at {0} and (c) agree to sharing my contact information with {2}.. + /// + public static string NewNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service has been created at {0}. + /// + public static string NewServiceCreatedMessage + { + get + { + return ResourceManager.GetString("NewServiceCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No. + /// + public static string No + { + get + { + return ResourceManager.GetString("No", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription.. + /// + public static string NoCachedToken + { + get + { + return ResourceManager.GetString("NoCachedToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole.. + /// + public static string NoCacheWorkerRoles + { + get + { + return ResourceManager.GetString("NoCacheWorkerRoles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No clouds available. + /// + public static string NoCloudsAvailable + { + get + { + return ResourceManager.GetString("NoCloudsAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "There is no current context, please log in using Connect-AzAccount.". + /// + public static string NoCurrentContextForDataCmdlet + { + get + { + return ResourceManager.GetString("NoCurrentContextForDataCmdlet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeDirectory + { + get + { + return ResourceManager.GetString("NodeDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeEngineKey + { + get + { + return ResourceManager.GetString("NodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node.exe. + /// + public static string NodeExe + { + get + { + return ResourceManager.GetString("NodeExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name>. + /// + public static string NoDefaultSubscriptionMessage + { + get + { + return ResourceManager.GetString("NoDefaultSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft SDKs\Azure\Nodejs\Nov2011. + /// + public static string NodeModulesPath + { + get + { + return ResourceManager.GetString("NodeModulesPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeProgramFilesFolderName + { + get + { + return ResourceManager.GetString("NodeProgramFilesFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeRuntimeValue + { + get + { + return ResourceManager.GetString("NodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\Node. + /// + public static string NodeScaffolding + { + get + { + return ResourceManager.GetString("NodeScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node. + /// + public static string NodeScaffoldingResources + { + get + { + return ResourceManager.GetString("NodeScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}). + /// + public static string NodeVersionWarningText + { + get + { + return ResourceManager.GetString("NodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No, I do not agree. + /// + public static string NoHint + { + get + { + return ResourceManager.GetString("NoHint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please connect to internet before executing this cmdlet. + /// + public static string NoInternetConnection + { + get + { + return ResourceManager.GetString("NoInternetConnection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <NONE>. + /// + public static string None + { + get + { + return ResourceManager.GetString("None", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No publish settings files with extension *.publishsettings are found in the directory "{0}".. + /// + public static string NoPublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("NoPublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no subscription associated with account {0}.. + /// + public static string NoSubscriptionAddedMessage + { + get + { + return ResourceManager.GetString("NoSubscriptionAddedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount?. + /// + public static string NoSubscriptionFoundForTenant + { + get + { + return ResourceManager.GetString("NoSubscriptionFoundForTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration.. + /// + public static string NotCacheWorkerRole + { + get + { + return ResourceManager.GetString("NotCacheWorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate can't be null.. + /// + public static string NullCertificateMessage + { + get + { + return ResourceManager.GetString("NullCertificateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} could not be null or empty. + /// + public static string NullObjectMessage + { + get + { + return ResourceManager.GetString("NullObjectMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add a null RoleSettings to {0}. + /// + public static string NullRoleSettingsMessage + { + get + { + return ResourceManager.GetString("NullRoleSettingsMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add new role to null service definition. + /// + public static string NullServiceDefinitionMessage + { + get + { + return ResourceManager.GetString("NullServiceDefinitionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request offer '{0}' is not found.. + /// + public static string OfferNotFoundMessage + { + get + { + return ResourceManager.GetString("OfferNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation "{0}" failed on VM with ID: {1}. + /// + public static string OperationFailedErrorMessage + { + get + { + return ResourceManager.GetString("OperationFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The REST operation failed with message '{0}' and error code '{1}'. + /// + public static string OperationFailedMessage + { + get + { + return ResourceManager.GetString("OperationFailedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state.. + /// + public static string OperationTimedOutOrError + { + get + { + return ResourceManager.GetString("OperationTimedOutOrError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package. + /// + public static string Package + { + get + { + return ResourceManager.GetString("Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Package is created at service root path {0}.. + /// + public static string PackageCreated + { + get + { + return ResourceManager.GetString("PackageCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {{ + /// "author": "", + /// + /// "name": "{0}", + /// "version": "0.0.0", + /// "dependencies":{{}}, + /// "devDependencies":{{}}, + /// "optionalDependencies": {{}}, + /// "engines": {{ + /// "node": "*", + /// "iisnode": "*" + /// }} + /// + ///}} + ///. + /// + public static string PackageJsonDefaultFile + { + get + { + return ResourceManager.GetString("PackageJsonDefaultFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package.json. + /// + public static string PackageJsonFileName + { + get + { + return ResourceManager.GetString("PackageJsonFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} doesn't exist.. + /// + public static string PathDoesNotExist + { + get + { + return ResourceManager.GetString("PathDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path for {0} doesn't exist in {1}.. + /// + public static string PathDoesNotExistForElement + { + get + { + return ResourceManager.GetString("PathDoesNotExistForElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Peer Asn has to be provided.. + /// + public static string PeerAsnRequired + { + get + { + return ResourceManager.GetString("PeerAsnRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 5.4.0. + /// + public static string PHPDefaultRuntimeVersion + { + get + { + return ResourceManager.GetString("PHPDefaultRuntimeVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to php. + /// + public static string PhpRuntimeValue + { + get + { + return ResourceManager.GetString("PhpRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\PHP. + /// + public static string PHPScaffolding + { + get + { + return ResourceManager.GetString("PHPScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP. + /// + public static string PHPScaffoldingResources + { + get + { + return ResourceManager.GetString("PHPScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}). + /// + public static string PHPVersionWarningText + { + get + { + return ResourceManager.GetString("PHPVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your first web site using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. At the bottom of the page, click on New > Web Site > Quick Create + ///2. Type {0} in the URL field + ///3. Click on "Create Web Site" + ///4. Once the site has been created, click on the site name + ///5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create.. + /// + public static string PortalInstructions + { + get + { + return ResourceManager.GetString("PortalInstructions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git". + /// + public static string PortalInstructionsGit + { + get + { + return ResourceManager.GetString("PortalInstructionsGit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This cmdlet is in preview. The functionality may not be available in the selected subscription. + /// + public static string PreviewCmdletMessage + { + get + { + return ResourceManager.GetString("PreviewCmdletMessage", resourceCulture); + } + } + + + /// + /// Looks up a localized string similar to A value for the Primary Peer Subnet has to be provided.. + /// + public static string PrimaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("PrimaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Promotion code can be used only when updating to a new plan.. + /// + public static string PromotionCodeWithCurrentPlanMessage + { + get + { + return ResourceManager.GetString("PromotionCodeWithCurrentPlanMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service not published at user request.. + /// + public static string PublishAbortedAtUserRequest + { + get + { + return ResourceManager.GetString("PublishAbortedAtUserRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete.. + /// + public static string PublishCompleteMessage + { + get + { + return ResourceManager.GetString("PublishCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connecting.... + /// + public static string PublishConnectingMessage + { + get + { + return ResourceManager.GetString("PublishConnectingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Deployment ID: {0}.. + /// + public static string PublishCreatedDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishCreatedDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created hosted service '{0}'.. + /// + public static string PublishCreatedServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatedServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Website URL: {0}.. + /// + public static string PublishCreatedWebsiteMessage + { + get + { + return ResourceManager.GetString("PublishCreatedWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating.... + /// + public static string PublishCreatingServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatingServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Initializing.... + /// + public static string PublishInitializingMessage + { + get + { + return ResourceManager.GetString("PublishInitializingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to busy. + /// + public static string PublishInstanceStatusBusy + { + get + { + return ResourceManager.GetString("PublishInstanceStatusBusy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to creating the virtual machine. + /// + public static string PublishInstanceStatusCreating + { + get + { + return ResourceManager.GetString("PublishInstanceStatusCreating", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Instance {0} of role {1} is {2}.. + /// + public static string PublishInstanceStatusMessage + { + get + { + return ResourceManager.GetString("PublishInstanceStatusMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ready. + /// + public static string PublishInstanceStatusReady + { + get + { + return ResourceManager.GetString("PublishInstanceStatusReady", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing deployment for {0} with Subscription ID: {1}.... + /// + public static string PublishPreparingDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishPreparingDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publishing {0} to Microsoft Azure. This may take several minutes.... + /// + public static string PublishServiceStartMessage + { + get + { + return ResourceManager.GetString("PublishServiceStartMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publish settings. + /// + public static string PublishSettings + { + get + { + return ResourceManager.GetString("PublishSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure. + /// + public static string PublishSettingsElementName + { + get + { + return ResourceManager.GetString("PublishSettingsElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to .PublishSettings. + /// + public static string PublishSettingsFileExtention + { + get + { + return ResourceManager.GetString("PublishSettingsFileExtention", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publishSettings.xml. + /// + public static string PublishSettingsFileName + { + get + { + return ResourceManager.GetString("PublishSettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &whr={0}. + /// + public static string PublishSettingsFileRealmFormat + { + get + { + return ResourceManager.GetString("PublishSettingsFileRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publish settings imported. + /// + public static string PublishSettingsSetSuccessfully + { + get + { + return ResourceManager.GetString("PublishSettingsSetSuccessfully", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PUBLISHINGPROFILE_URL. + /// + public static string PublishSettingsUrlEnv + { + get + { + return ResourceManager.GetString("PublishSettingsUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting.... + /// + public static string PublishStartingMessage + { + get + { + return ResourceManager.GetString("PublishStartingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upgrading.... + /// + public static string PublishUpgradingMessage + { + get + { + return ResourceManager.GetString("PublishUpgradingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Uploading Package to storage service {0}.... + /// + public static string PublishUploadingPackageMessage + { + get + { + return ResourceManager.GetString("PublishUploadingPackageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Verifying storage account '{0}'.... + /// + public static string PublishVerifyingStorageMessage + { + get + { + return ResourceManager.GetString("PublishVerifyingStorageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionAdditionalContentPathNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionAdditionalContentPathNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration published to {0}. + /// + public static string PublishVMDscExtensionArchiveUploadedMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionArchiveUploadedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyFileVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyFileVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy the module '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyModuleVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyModuleVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1).. + /// + public static string PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleted '{0}'. + /// + public static string PublishVMDscExtensionDeletedFileMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeletedFileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot delete '{0}': {1}. + /// + public static string PublishVMDscExtensionDeleteErrorMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeleteErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionDirectoryNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDirectoryNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot get module for DscResource '{0}'. Possible solutions: + ///1) Specify -ModuleName for Import-DscResource in your configuration. + ///2) Unblock module that contains resource. + ///3) Move Import-DscResource inside Node block. + ///. + /// + public static string PublishVMDscExtensionGetDscResourceFailed + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionGetDscResourceFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to List of required modules: [{0}].. + /// + public static string PublishVMDscExtensionRequiredModulesVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredModulesVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version.. + /// + public static string PublishVMDscExtensionRequiredPsVersion + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredPsVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration script '{0}' contained parse errors: + ///{1}. + /// + public static string PublishVMDscExtensionStorageParserErrors + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionStorageParserErrors", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Temp folder '{0}' created.. + /// + public static string PublishVMDscExtensionTempFolderVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionTempFolderVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip).. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration file '{0}' not found.. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. + ///Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enab [rest of string was truncated]";. + /// + public static string RDFEDataCollectionMessage + { + get + { + return ResourceManager.GetString("RDFEDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replace current deployment with '{0}' Id ?. + /// + public static string RedeployCommit + { + get + { + return ResourceManager.GetString("RedeployCommit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to regenerate key?. + /// + public static string RegenerateKeyWarning + { + get + { + return ResourceManager.GetString("RegenerateKeyWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Generate new key.. + /// + public static string RegenerateKeyWhatIfMessage + { + get + { + return ResourceManager.GetString("RegenerateKeyWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove account '{0}'?. + /// + public static string RemoveAccountConfirmation + { + get + { + return ResourceManager.GetString("RemoveAccountConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing account. + /// + public static string RemoveAccountMessage + { + get + { + return ResourceManager.GetString("RemoveAccountMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove Add-On Confirmation. + /// + public static string RemoveAddOnConformation + { + get + { + return ResourceManager.GetString("RemoveAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm.. + /// + public static string RemoveAddOnMessage + { + get + { + return ResourceManager.GetString("RemoveAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureBGPPeering Operation failed.. + /// + public static string RemoveAzureBGPPeeringFailed + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Bgp Peering. + /// + public static string RemoveAzureBGPPeeringMessage + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Bgp Peering with Service Key {0}.. + /// + public static string RemoveAzureBGPPeeringSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Bgp Peering with service key '{0}'?. + /// + public static string RemoveAzureBGPPeeringWarning + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit with service key '{0}'?. + /// + public static string RemoveAzureDedicatdCircuitWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatdCircuitWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuit Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuitLink Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitLinkFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circui Link. + /// + public static string RemoveAzureDedicatedCircuitLinkMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1}. + /// + public static string RemoveAzureDedicatedCircuitLinkSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'?. + /// + public static string RemoveAzureDedicatedCircuitLinkWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circuit. + /// + public static string RemoveAzureDedicatedCircuitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit with Service Key {0}.. + /// + public static string RemoveAzureDedicatedCircuitSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing cloud service {0}.... + /// + public static string RemoveAzureServiceWaitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureServiceWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription.. + /// + public static string RemoveDefaultSubscription + { + get + { + return ResourceManager.GetString("RemoveDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing {0} deployment for {1} service. + /// + public static string RemoveDeploymentWaitMessage + { + get + { + return ResourceManager.GetString("RemoveDeploymentWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'?. + /// + public static string RemoveEnvironmentConfirmation + { + get + { + return ResourceManager.GetString("RemoveEnvironmentConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing environment. + /// + public static string RemoveEnvironmentMessage + { + get + { + return ResourceManager.GetString("RemoveEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job collection. + /// + public static string RemoveJobCollectionMessage + { + get + { + return ResourceManager.GetString("RemoveJobCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job collection "{0}". + /// + public static string RemoveJobCollectionWarning + { + get + { + return ResourceManager.GetString("RemoveJobCollectionWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job. + /// + public static string RemoveJobMessage + { + get + { + return ResourceManager.GetString("RemoveJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job "{0}". + /// + public static string RemoveJobWarning + { + get + { + return ResourceManager.GetString("RemoveJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the account?. + /// + public static string RemoveMediaAccountWarning + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account removed.. + /// + public static string RemoveMediaAccountWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription.. + /// + public static string RemoveNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("RemoveNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing old package {0}.... + /// + public static string RemovePackage + { + get + { + return ResourceManager.GetString("RemovePackage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile?. + /// + public static string RemoveProfileConfirmation + { + get + { + return ResourceManager.GetString("RemoveProfileConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile. + /// + public static string RemoveProfileMessage + { + get + { + return ResourceManager.GetString("RemoveProfileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the namespace '{0}'?. + /// + public static string RemoveServiceBusNamespaceConfirmation + { + get + { + return ResourceManager.GetString("RemoveServiceBusNamespaceConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove cloud service?. + /// + public static string RemoveServiceWarning + { + get + { + return ResourceManager.GetString("RemoveServiceWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove cloud service and all it's deployments. + /// + public static string RemoveServiceWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveServiceWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove subscription '{0}'?. + /// + public static string RemoveSubscriptionConfirmation + { + get + { + return ResourceManager.GetString("RemoveSubscriptionConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing subscription. + /// + public static string RemoveSubscriptionMessage + { + get + { + return ResourceManager.GetString("RemoveSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The endpoint {0} cannot be removed from profile {1} because it's not in the profile.. + /// + public static string RemoveTrafficManagerEndpointMissing + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerEndpointMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureTrafficManagerProfile Operation failed.. + /// + public static string RemoveTrafficManagerProfileFailed + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Traffic Manager profile with name {0}.. + /// + public static string RemoveTrafficManagerProfileSucceeded + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Traffic Manager profile "{0}"?. + /// + public static string RemoveTrafficManagerProfileWarning + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the VM '{0}'?. + /// + public static string RemoveVMConfirmationMessage + { + get + { + return ResourceManager.GetString("RemoveVMConfirmationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting VM.. + /// + public static string RemoveVMMessage + { + get + { + return ResourceManager.GetString("RemoveVMMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing WebJob.... + /// + public static string RemoveWebJobMessage + { + get + { + return ResourceManager.GetString("RemoveWebJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove job '{0}'?. + /// + public static string RemoveWebJobWarning + { + get + { + return ResourceManager.GetString("RemoveWebJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing website. + /// + public static string RemoveWebsiteMessage + { + get + { + return ResourceManager.GetString("RemoveWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the website "{0}". + /// + public static string RemoveWebsiteWarning + { + get + { + return ResourceManager.GetString("RemoveWebsiteWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing public environment is not supported.. + /// + public static string RemovingDefaultEnvironmentsNotSupported + { + get + { + return ResourceManager.GetString("RemovingDefaultEnvironmentsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting namespace. + /// + public static string RemovingNamespaceMessage + { + get + { + return ResourceManager.GetString("RemovingNamespaceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Repository is not setup. You need to pass a valid site name.. + /// + public static string RepositoryNotSetup + { + get + { + return ResourceManager.GetString("RepositoryNotSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use.. + /// + public static string ReservedIPNameNoLongerInUseButStillBeingReserved + { + get + { + return ResourceManager.GetString("ReservedIPNameNoLongerInUseButStillBeingReserved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resource with ID : {0} does not exist.. + /// + public static string ResourceNotFound + { + get + { + return ResourceManager.GetString("ResourceNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Restart. + /// + public static string Restart + { + get + { + return ResourceManager.GetString("Restart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resume. + /// + public static string Resume + { + get + { + return ResourceManager.GetString("Resume", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /role:{0};"{1}/{0}" . + /// + public static string RoleArgTemplate + { + get + { + return ResourceManager.GetString("RoleArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to bin. + /// + public static string RoleBinFolderName + { + get + { + return ResourceManager.GetString("RoleBinFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} is {1}. + /// + public static string RoleInstanceWaitMsg + { + get + { + return ResourceManager.GetString("RoleInstanceWaitMsg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 20. + /// + public static string RoleMaxInstances + { + get + { + return ResourceManager.GetString("RoleMaxInstances", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to role name. + /// + public static string RoleName + { + get + { + return ResourceManager.GetString("RoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name {0} doesn't exist. + /// + public static string RoleNotFoundMessage + { + get + { + return ResourceManager.GetString("RoleNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RoleSettings.xml. + /// + public static string RoleSettingsTemplateFileName + { + get + { + return ResourceManager.GetString("RoleSettingsTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role type {0} doesn't exist. + /// + public static string RoleTypeDoesNotExist + { + get + { + return ResourceManager.GetString("RoleTypeDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to public static Dictionary<string, Location> ReverseLocations { get; private set; }. + /// + public static string RuntimeDeploymentLocationError + { + get + { + return ResourceManager.GetString("RuntimeDeploymentLocationError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing runtime deployment for service '{0}'. + /// + public static string RuntimeDeploymentStart + { + get + { + return ResourceManager.GetString("RuntimeDeploymentStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version?. + /// + public static string RuntimeMismatchWarning + { + get + { + return ResourceManager.GetString("RuntimeMismatchWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEOVERRIDEURL. + /// + public static string RuntimeOverrideKey + { + get + { + return ResourceManager.GetString("RuntimeOverrideKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /runtimemanifest/runtimes/runtime. + /// + public static string RuntimeQuery + { + get + { + return ResourceManager.GetString("RuntimeQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEID. + /// + public static string RuntimeTypeKey + { + get + { + return ResourceManager.GetString("RuntimeTypeKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEURL. + /// + public static string RuntimeUrlKey + { + get + { + return ResourceManager.GetString("RuntimeUrlKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEVERSIONPRIMARYKEY. + /// + public static string RuntimeVersionPrimaryKey + { + get + { + return ResourceManager.GetString("RuntimeVersionPrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to scaffold.xml. + /// + public static string ScaffoldXml + { + get + { + return ResourceManager.GetString("ScaffoldXml", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation. + /// + public static string SchedulerInvalidLocation + { + get + { + return ResourceManager.GetString("SchedulerInvalidLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Secondary Peer Subnet has to be provided.. + /// + public static string SecondaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("SecondaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} already exists on disk in location {1}. + /// + public static string ServiceAlreadyExistsOnDisk + { + get + { + return ResourceManager.GetString("ServiceAlreadyExistsOnDisk", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No ServiceBus authorization rule with the given characteristics was found. + /// + public static string ServiceBusAuthorizationRuleNotFound + { + get + { + return ResourceManager.GetString("ServiceBusAuthorizationRuleNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service bus entity '{0}' is not found.. + /// + public static string ServiceBusEntityTypeNotFound + { + get + { + return ResourceManager.GetString("ServiceBusEntityTypeNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen due to an incorrect/missing namespace. + /// + public static string ServiceBusNamespaceMissingMessage + { + get + { + return ResourceManager.GetString("ServiceBusNamespaceMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service configuration. + /// + public static string ServiceConfiguration + { + get + { + return ResourceManager.GetString("ServiceConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service definition. + /// + public static string ServiceDefinition + { + get + { + return ResourceManager.GetString("ServiceDefinition", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceDefinition.csdef. + /// + public static string ServiceDefinitionFileName + { + get + { + return ResourceManager.GetString("ServiceDefinitionFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}Deploy. + /// + public static string ServiceDeploymentName + { + get + { + return ResourceManager.GetString("ServiceDeploymentName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified cloud service "{0}" does not exist.. + /// + public static string ServiceDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is in {2} state, please wait until it finish and update it's status. + /// + public static string ServiceIsInTransitionState + { + get + { + return ResourceManager.GetString("ServiceIsInTransitionState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}.". + /// + public static string ServiceManagementClientExceptionStringFormat + { + get + { + return ResourceManager.GetString("ServiceManagementClientExceptionStringFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service name. + /// + public static string ServiceName + { + get + { + return ResourceManager.GetString("ServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided service name {0} already exists, please pick another name. + /// + public static string ServiceNameExists + { + get + { + return ResourceManager.GetString("ServiceNameExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide name for the hosted service. + /// + public static string ServiceNameMissingMessage + { + get + { + return ResourceManager.GetString("ServiceNameMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service parent directory. + /// + public static string ServiceParentDirectory + { + get + { + return ResourceManager.GetString("ServiceParentDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} removed successfully. + /// + public static string ServiceRemovedMessage + { + get + { + return ResourceManager.GetString("ServiceRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service directory. + /// + public static string ServiceRoot + { + get + { + return ResourceManager.GetString("ServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service settings. + /// + public static string ServiceSettings + { + get + { + return ResourceManager.GetString("ServiceSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.. + /// + public static string ServiceSettings_ValidateStorageAccountName_InvalidName + { + get + { + return ResourceManager.GetString("ServiceSettings_ValidateStorageAccountName_InvalidName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for cloud service {1} doesn't exist.. + /// + public static string ServiceSlotDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceSlotDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is {2}. + /// + public static string ServiceStatusChanged + { + get + { + return ResourceManager.GetString("ServiceStatusChanged", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Set Add-On Confirmation. + /// + public static string SetAddOnConformation + { + get + { + return ResourceManager.GetString("SetAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} does not contain endpoint {1}. Adding it.. + /// + public static string SetInexistentTrafficManagerEndpointMessage + { + get + { + return ResourceManager.GetString("SetInexistentTrafficManagerEndpointMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string SetMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at <url> and (c) agree to sharing my contact information with {2}.. + /// + public static string SetNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances are set to {1}. + /// + public static string SetRoleInstancesMessage + { + get + { + return ResourceManager.GetString("SetRoleInstancesMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"Slot":"","Location":"","Subscription":"","StorageAccountName":""}. + /// + public static string SettingsFileEmptyContent + { + get + { + return ResourceManager.GetString("SettingsFileEmptyContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to deploymentSettings.json. + /// + public static string SettingsFileName + { + get + { + return ResourceManager.GetString("SettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insufficient parameters passed to create a new endpoint.. + /// + public static string SetTrafficManagerEndpointNeedsParameters + { + get + { + return ResourceManager.GetString("SetTrafficManagerEndpointNeedsParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ambiguous operation: the profile name specified doesn't match the name of the profile object.. + /// + public static string SetTrafficManagerProfileAmbiguous + { + get + { + return ResourceManager.GetString("SetTrafficManagerProfileAmbiguous", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts.. + /// + public static string ShouldContinueFail + { + get + { + return ResourceManager.GetString("ShouldContinueFail", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confirm. + /// + public static string ShouldProcessCaption + { + get + { + return ResourceManager.GetString("ShouldProcessCaption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailConfirm + { + get + { + return ResourceManager.GetString("ShouldProcessFailConfirm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again.. + /// + public static string ShouldProcessFailImpact + { + get + { + return ResourceManager.GetString("ShouldProcessFailImpact", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailWhatIf + { + get + { + return ResourceManager.GetString("ShouldProcessFailWhatIf", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shutdown. + /// + public static string Shutdown + { + get + { + return ResourceManager.GetString("Shutdown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /sites:{0};{1};"{2}/{0}" . + /// + public static string SitesArgTemplate + { + get + { + return ResourceManager.GetString("SitesArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string StandardRetryDelayInMs + { + get + { + return ResourceManager.GetString("StandardRetryDelayInMs", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start. + /// + public static string Start + { + get + { + return ResourceManager.GetString("Start", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Started. + /// + public static string StartedEmulator + { + get + { + return ResourceManager.GetString("StartedEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting Emulator.... + /// + public static string StartingEmulator + { + get + { + return ResourceManager.GetString("StartingEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to start. + /// + public static string StartStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StartStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop. + /// + public static string Stop + { + get + { + return ResourceManager.GetString("Stop", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopping emulator.... + /// + public static string StopEmulatorMessage + { + get + { + return ResourceManager.GetString("StopEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopped. + /// + public static string StoppedEmulatorMessage + { + get + { + return ResourceManager.GetString("StoppedEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to stop. + /// + public static string StopStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StopStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account Name:. + /// + public static string StorageAccountName + { + get + { + return ResourceManager.GetString("StorageAccountName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find storage account '{0}' please type the name of an existing storage account.. + /// + public static string StorageAccountNotFound + { + get + { + return ResourceManager.GetString("StorageAccountNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AzureStorageEmulator.exe. + /// + public static string StorageEmulatorExe + { + get + { + return ResourceManager.GetString("StorageEmulatorExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to InstallPath. + /// + public static string StorageEmulatorInstallPathRegistryKeyValue + { + get + { + return ResourceManager.GetString("StorageEmulatorInstallPathRegistryKeyValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SOFTWARE\Microsoft\Windows Azure Storage Emulator. + /// + public static string StorageEmulatorRegistryKey + { + get + { + return ResourceManager.GetString("StorageEmulatorRegistryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Primary Key:. + /// + public static string StoragePrimaryKey + { + get + { + return ResourceManager.GetString("StoragePrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Secondary Key:. + /// + public static string StorageSecondaryKey + { + get + { + return ResourceManager.GetString("StorageSecondaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} already exists.. + /// + public static string SubscriptionAlreadyExists + { + get + { + return ResourceManager.GetString("SubscriptionAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information.. + /// + public static string SubscriptionDataFileDeprecated + { + get + { + return ResourceManager.GetString("SubscriptionDataFileDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DefaultSubscriptionData.xml. + /// + public static string SubscriptionDataFileName + { + get + { + return ResourceManager.GetString("SubscriptionDataFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription data file {0} does not exist.. + /// + public static string SubscriptionDataFileNotFound + { + get + { + return ResourceManager.GetString("SubscriptionDataFileNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription id {0} doesn't exist.. + /// + public static string SubscriptionIdNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionIdNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription must not be null. + /// + public static string SubscriptionMustNotBeNull + { + get + { + return ResourceManager.GetString("SubscriptionMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription name needs to be specified.. + /// + public static string SubscriptionNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription name {0} doesn't exist.. + /// + public static string SubscriptionNameNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionNameNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription needs to be specified.. + /// + public static string SubscriptionNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Suspend. + /// + public static string Suspend + { + get + { + return ResourceManager.GetString("Suspend", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Swapping website production slot .... + /// + public static string SwappingWebsite + { + get + { + return ResourceManager.GetString("SwappingWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to swap the website '{0}' production slot with slot '{1}'?. + /// + public static string SwapWebsiteSlotWarning + { + get + { + return ResourceManager.GetString("SwapWebsiteSlotWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Switch-AzureMode cmdlet is deprecated and will be removed in a future release.. + /// + public static string SwitchAzureModeDeprecated + { + get + { + return ResourceManager.GetString("SwitchAzureModeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}'. + /// + public static string TraceBeginLROJob + { + get + { + return ResourceManager.GetString("TraceBeginLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}'. + /// + public static string TraceBlockLROThread + { + get + { + return ResourceManager.GetString("TraceBlockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Completing cmdlet execution in RunJob. + /// + public static string TraceEndLROJob + { + get + { + return ResourceManager.GetString("TraceEndLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}'. + /// + public static string TraceHandleLROStateChange + { + get + { + return ResourceManager.GetString("TraceHandleLROStateChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job due to stoppage or failure. + /// + public static string TraceHandlerCancelJob + { + get + { + return ResourceManager.GetString("TraceHandlerCancelJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job that was previously blocked.. + /// + public static string TraceHandlerUnblockJob + { + get + { + return ResourceManager.GetString("TraceHandlerUnblockJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Error in cmdlet execution. + /// + public static string TraceLROJobException + { + get + { + return ResourceManager.GetString("TraceLROJobException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Removing state changed event handler, exception '{0}'. + /// + public static string TraceRemoveLROEventHandler + { + get + { + return ResourceManager.GetString("TraceRemoveLROEventHandler", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: ShouldMethod '{0}' unblocked.. + /// + public static string TraceUnblockLROThread + { + get + { + return ResourceManager.GetString("TraceUnblockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}.. + /// + public static string UnableToDecodeBase64String + { + get + { + return ResourceManager.GetString("UnableToDecodeBase64String", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to update mismatching Json structured: {0} {1}.. + /// + public static string UnableToPatchJson + { + get + { + return ResourceManager.GetString("UnableToPatchJson", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provider {0} is unknown.. + /// + public static string UnknownProviderMessage + { + get + { + return ResourceManager.GetString("UnknownProviderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update. + /// + public static string Update + { + get + { + return ResourceManager.GetString("Update", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updated settings for subscription '{0}'. Current subscription is '{1}'.. + /// + public static string UpdatedSettings + { + get + { + return ResourceManager.GetString("UpdatedSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name is not valid.. + /// + public static string UserNameIsNotValid + { + get + { + return ResourceManager.GetString("UserNameIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name needs to be specified.. + /// + public static string UserNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("UserNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the VLan Id has to be provided.. + /// + public static string VlanIdRequired + { + get + { + return ResourceManager.GetString("VlanIdRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please wait.... + /// + public static string WaitMessage + { + get + { + return ResourceManager.GetString("WaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The azure storage emulator is not installed, skip launching.... + /// + public static string WarningWhenStorageEmulatorIsMissing + { + get + { + return ResourceManager.GetString("WarningWhenStorageEmulatorIsMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Web.cloud.config. + /// + public static string WebCloudConfig + { + get + { + return ResourceManager.GetString("WebCloudConfig", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to web.config. + /// + public static string WebConfigTemplateFileName + { + get + { + return ResourceManager.GetString("WebConfigTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to MSDeploy. + /// + public static string WebDeployKeywordInWebSitePublishProfile + { + get + { + return ResourceManager.GetString("WebDeployKeywordInWebSitePublishProfile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot build the project successfully. Please see logs in {0}.. + /// + public static string WebProjectBuildFailTemplate + { + get + { + return ResourceManager.GetString("WebProjectBuildFailTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole. + /// + public static string WebRole + { + get + { + return ResourceManager.GetString("WebRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_web.cmd > log.txt. + /// + public static string WebRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WebRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole.xml. + /// + public static string WebRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WebRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Webspace.. + /// + public static string WebsiteAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Location.. + /// + public static string WebsiteAlreadyExistsReplacement + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExistsReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Site {0} already has repository created for it.. + /// + public static string WebsiteRepositoryAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteRepositoryAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Workspaces/WebsiteExtension/Website/{0}/dashboard/. + /// + public static string WebsiteSufixUrl + { + get + { + return ResourceManager.GetString("WebsiteSufixUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}/msdeploy.axd?site={1}. + /// + public static string WebSiteWebDeployUriTemplate + { + get + { + return ResourceManager.GetString("WebSiteWebDeployUriTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole. + /// + public static string WorkerRole + { + get + { + return ResourceManager.GetString("WorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_worker.cmd > log.txt. + /// + public static string WorkerRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WorkerRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole.xml. + /// + public static string WorkerRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WorkerRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to (x86). + /// + public static string x86InProgramFiles + { + get + { + return ResourceManager.GetString("x86InProgramFiles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes. + /// + public static string Yes + { + get + { + return ResourceManager.GetString("Yes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes, I agree. + /// + public static string YesHint + { + get + { + return ResourceManager.GetString("YesHint", resourceCulture); + } + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/Properties/Resources.resx b/swaggerci/storSimple1200Series/generated/runtime/Properties/Resources.resx new file mode 100644 index 000000000000..598cd53e958a --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Properties/Resources.resx @@ -0,0 +1,1741 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The remote server returned an error: (401) Unauthorized. + + + Account "{0}" has been added. + + + To switch to a different subscription, please use Select-AzureSubscription. + + + Subscription "{0}" is selected as the default subscription. + + + To view all the subscriptions, please use Get-AzureSubscription. + + + Add-On {0} is created successfully. + + + Add-on name {0} is already used. + + + Add-On {0} not found. + + + Add-on {0} is removed successfully. + + + Add-On {0} is updated successfully. + + + Role has been created at {0}\{1}. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure". + + + Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator + + + A role name '{0}' already exists + + + Windows Azure Powershell\ + + + https://manage.windowsazure.com + + + AZURE_PORTAL_URL + + + Azure SDK\{0}\ + + + Base Uri was empty. + WAPackIaaS + + + {0} begin processing without ParameterSet. + + + {0} begin processing with ParameterSet '{1}'. + + + Blob with the name {0} already exists in the account. + + + https://{0}.blob.core.windows.net/ + + + AZURE_BLOBSTORAGE_TEMPLATE + + + CACHERUNTIMEURL + + + cache + + + CacheRuntimeVersion + + + Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}) + + + Cannot find {0} with name {1}. + + + Deployment for service {0} with {1} slot doesn't exist + + + Can't find valid Microsoft Azure role in current directory {0} + + + service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist + + + Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders. + + + The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated. + + + ManagementCertificate + + + certificate.pfx + + + Certificate imported into CurrentUser\My\{0} + + + Your account does not have access to the private key for certificate {0} + + + {0} {1} deployment for {2} service + + + Cloud service {0} is in {1} state. + + + Changing/Removing public environment '{0}' is not allowed. + + + Service {0} is set to value {1} + + + Choose which publish settings file to use: + + + Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel + + + 1 + + + cloud_package.cspkg + + + ServiceConfiguration.Cloud.cscfg + + + Add-ons for {0} + + + Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive. + + + Complete + + + config.json + + + VirtualMachine creation failed. + WAPackIaaS + + + Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead. + + + Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core + + + //blobcontainer[@datacenter='{0}'] + + + Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription + + + none + + + There are no hostnames which could be used for validation. + + + 8080 + + + 1000 + + + Auto + + + 80 + + + Delete + WAPackIaaS + + + The {0} slot for service {1} is already in {2} state + + + The deployment in {0} slot for service {1} is removed + + + Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel + + + 1 + + + The key to add already exists in the dictionary. + + + The array index cannot be less than zero. + + + The supplied array does not have enough room to contain the copied elements. + + + The provided dns {0} doesn't exist + + + Microsoft Azure Certificate + + + Endpoint can't be retrieved for storage account + + + {0} end processing. + + + To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet. + + + The environment '{0}' already exists. + + + environments.xml + + + Error creating VirtualMachine + WAPackIaaS + + + Unable to download available runtimes for location '{0}' + + + Error updating VirtualMachine + WAPackIaaS + + + Job Id {0} failed. Error: {1}, ExceptionDetails: {2} + WAPackIaaS + + + The HTTP request was forbidden with client authentication scheme 'Anonymous'. + + + This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell. + + + Operation Status: + + + Resources\Scaffolding\General + + + Getting all available Microsoft Azure Add-Ons, this may take few minutes... + + + Name{0}Primary Key{0}Seconday Key + + + Git not found. Please install git and place it in your command line path. + + + Could not find publish settings. Please run Import-AzurePublishSettingsFile. + + + iisnode.dll + + + iisnode + + + iisnode-dev\\release\\x64 + + + iisnode + + + Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}) + + + Internal Server Error + + + Cannot enable memcach protocol on a cache worker role {0}. + + + Invalid certificate format. + + + The provided configuration path is invalid or doesn't exist + + + The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2. + + + Deployment with {0} does not exist + + + The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production". + + + Invalid service endpoint. + + + File {0} has invalid characters + + + You must create your git publishing credentials using the Microsoft Azure portal. +Please follow these steps in the portal: +1. On the left side open "Web Sites" +2. Click on any website +3. Choose "Setup Git Publishing" or "Reset deployment credentials" +4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username} + + + The value {0} provided is not a valid GUID. Please provide a valid GUID. + + + The specified hostname does not exist. Please specify a valid hostname for the site. + + + Role {0} instances must be greater than or equal 0 and less than or equal 20 + + + There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file. + + + Could not download a valid runtime manifest, Please check your internet connection and try again. + + + The account {0} was not found. Please specify a valid account name. + + + The provided name "{0}" does not match the service bus namespace naming rules. + + + Value cannot be null. Parameter name: '{0}' + + + The provided package path is invalid or doesn't exist + + + '{0}' is an invalid parameter set name. + + + {0} doesn't exist in {1} or you've not passed valid value for it + + + Path {0} has invalid characters + + + The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile + + + The provided role name "{0}" has invalid characters + + + A valid name for the service root folder is required + + + {0} is not a recognized runtime type + + + A valid language is required + + + No subscription is currently selected. Use Select-Subscription to activate a subscription. + + + The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations. + + + Please provide a service name or run this command from inside a service project directory. + + + You must provide valid value for {0} + + + settings.json is invalid or doesn't exist + + + The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data. + + + The provided subscription id {0} is not valid + + + A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet + + + The provided subscriptions file {0} has invalid content. + + + Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge. + + + The web job file must have *.zip extension + + + Singleton option works for continuous jobs only. + + + The website {0} was not found. Please specify a valid website name. + + + No job for id: {0} was found. + WAPackIaaS + + + engines + + + Scaffolding for this language is not yet supported + + + Link already established + + + local_package.csx + + + ServiceConfiguration.Local.cscfg + + + Looking for {0} deployment for {1} cloud service... + + + Looking for cloud service {0}... + + + managementCertificate.pem + + + ?whr={0} + + + //baseuri + + + uri + + + http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml + + + Multiple Add-Ons found holding name {0} + + + Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername. + + + The first publish settings file "{0}" is used. If you want to use another file specify the file name. + + + Microsoft.WindowsAzure.Plugins.Caching.NamedCaches + + + {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]} + + + A publishing username is required. Please specify one using the argument PublishingUsername. + + + New Add-On Confirmation + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names. + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at {0} and (c) agree to sharing my contact information with {2}. + + + Service has been created at {0} + + + No + + + There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription. + + + The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole. + + + No clouds available + WAPackIaaS + + + nodejs + + + node + + + node.exe + + + There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name> + + + Microsoft SDKs\Azure\Nodejs\Nov2011 + + + nodejs + + + node + + + Resources\Scaffolding\Node + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node + + + Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}) + + + No, I do not agree + + + No publish settings files with extension *.publishsettings are found in the directory "{0}". + + + '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration. + + + Certificate can't be null. + + + {0} could not be null or empty + + + Unable to add a null RoleSettings to {0} + + + Unable to add new role to null service definition + + + The request offer '{0}' is not found. + + + Operation "{0}" failed on VM with ID: {1} + WAPackIaaS + + + The REST operation failed with message '{0}' and error code '{1}' + + + Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state. + WAPackIaaS + + + package + + + Package is created at service root path {0}. + + + {{ + "author": "", + + "name": "{0}", + "version": "0.0.0", + "dependencies":{{}}, + "devDependencies":{{}}, + "optionalDependencies": {{}}, + "engines": {{ + "node": "*", + "iisnode": "*" + }} + +}} + + + + package.json + + + A value for the Peer Asn has to be provided. + + + 5.4.0 + + + php + + + Resources\Scaffolding\PHP + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP + + + Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}) + + + You must create your first web site using the Microsoft Azure portal. +Please follow these steps in the portal: +1. At the bottom of the page, click on New > Web Site > Quick Create +2. Type {0} in the URL field +3. Click on "Create Web Site" +4. Once the site has been created, click on the site name +5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create. + + + 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git" + + + A value for the Primary Peer Subnet has to be provided. + + + Promotion code can be used only when updating to a new plan. + + + Service not published at user request. + + + Complete. + + + Connecting... + + + Created Deployment ID: {0}. + + + Created hosted service '{0}'. + + + Created Website URL: {0}. + + + Creating... + + + Initializing... + + + busy + + + creating the virtual machine + + + Instance {0} of role {1} is {2}. + + + ready + + + Preparing deployment for {0} with Subscription ID: {1}... + + + Publishing {0} to Microsoft Azure. This may take several minutes... + + + publish settings + + + Azure + + + .PublishSettings + + + publishSettings.xml + + + Publish settings imported + + + AZURE_PUBLISHINGPROFILE_URL + + + Starting... + + + Upgrading... + + + Uploading Package to storage service {0}... + + + Verifying storage account '{0}'... + + + Replace current deployment with '{0}' Id ? + + + Are you sure you want to regenerate key? + + + Generate new key. + + + Are you sure you want to remove account '{0}'? + + + Removing account + + + Remove Add-On Confirmation + + + If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm. + + + Remove-AzureBGPPeering Operation failed. + + + Removing Bgp Peering + + + Successfully removed Azure Bgp Peering with Service Key {0}. + + + Are you sure you want to remove the Bgp Peering with service key '{0}'? + + + Are you sure you want to remove the Dedicated Circuit with service key '{0}'? + + + Remove-AzureDedicatedCircuit Operation failed. + + + Remove-AzureDedicatedCircuitLink Operation failed. + + + Removing Dedicated Circui Link + + + Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1} + + + Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'? + + + Removing Dedicated Circuit + + + Successfully removed Azure Dedicated Circuit with Service Key {0}. + + + Removing cloud service {0}... + + + Removing {0} deployment for {1} service + + + Removing job collection + + + Are you sure you want to remove the job collection "{0}" + + + Removing job + + + Are you sure you want to remove the job "{0}" + + + Are you sure you want to remove the account? + + + Account removed. + + + Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription. + + + Removing old package {0}... + + + Are you sure you want to delete the namespace '{0}'? + + + Are you sure you want to remove cloud service? + + + Remove cloud service and all it's deployments + + + Are you sure you want to remove subscription '{0}'? + + + Removing subscription + + + Are you sure you want to delete the VM '{0}'? + + + Deleting VM. + + + Removing WebJob... + + + Are you sure you want to remove job '{0}'? + + + Removing website + + + Are you sure you want to remove the website "{0}" + + + Deleting namespace + + + Repository is not setup. You need to pass a valid site name. + + + Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use. + + + Resource with ID : {0} does not exist. + WAPackIaaS + + + Restart + WAPackIaaS + + + Resume + WAPackIaaS + + + /role:{0};"{1}/{0}" + + + bin + + + Role {0} is {1} + + + 20 + + + role name + + + The provided role name {0} doesn't exist + + + RoleSettings.xml + + + Role type {0} doesn't exist + + + public static Dictionary<string, Location> ReverseLocations { get; private set; } + + + Preparing runtime deployment for service '{0}' + + + WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version? + + + RUNTIMEOVERRIDEURL + + + /runtimemanifest/runtimes/runtime + + + RUNTIMEID + + + RUNTIMEURL + + + RUNTIMEVERSIONPRIMARYKEY + + + scaffold.xml + + + Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation + + + A value for the Secondary Peer Subnet has to be provided. + + + Service {0} already exists on disk in location {1} + + + No ServiceBus authorization rule with the given characteristics was found + + + The service bus entity '{0}' is not found. + + + Internal Server Error. This could happen due to an incorrect/missing namespace + + + service configuration + + + service definition + + + ServiceDefinition.csdef + + + {0}Deploy + + + The specified cloud service "{0}" does not exist. + + + {0} slot for service {1} is in {2} state, please wait until it finish and update it's status + + + Begin Operation: {0} + + + Completed Operation: {0} + + + Begin Operation: {0} + + + Completed Operation: {0} + + + service name + + + Please provide name for the hosted service + + + service parent directory + + + Service {0} removed successfully + + + service directory + + + service settings + + + The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + + + The {0} slot for cloud service {1} doesn't exist. + + + {0} slot for service {1} is {2} + + + Set Add-On Confirmation + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at <url> and (c) agree to sharing my contact information with {2}. + + + Role {0} instances are set to {1} + + + {"Slot":"","Location":"","Subscription":"","StorageAccountName":""} + + + deploymentSettings.json + + + Confirm + + + Shutdown + WAPackIaaS + + + /sites:{0};{1};"{2}/{0}" + + + 1000 + + + Start + WAPackIaaS + + + Started + + + Starting Emulator... + + + start + + + Stop + WAPackIaaS + + + Stopping emulator... + + + Stopped + + + stop + + + Account Name: + + + Cannot find storage account '{0}' please type the name of an existing storage account. + + + AzureStorageEmulator.exe + + + InstallPath + + + SOFTWARE\Microsoft\Windows Azure Storage Emulator + + + Primary Key: + + + Secondary Key: + + + The subscription named {0} already exists. + + + DefaultSubscriptionData.xml + + + The subscription data file {0} does not exist. + + + Subscription must not be null + WAPackIaaS + + + Suspend + WAPackIaaS + + + Swapping website production slot ... + + + Are you sure you want to swap the website '{0}' production slot with slot '{1}'? + + + The provider {0} is unknown. + + + Update + WAPackIaaS + + + Updated settings for subscription '{0}'. Current subscription is '{1}'. + + + A value for the VLan Id has to be provided. + + + Please wait... + + + The azure storage emulator is not installed, skip launching... + + + Web.cloud.config + + + web.config + + + MSDeploy + + + Cannot build the project successfully. Please see logs in {0}. + + + WebRole + + + setup_web.cmd > log.txt + + + WebRole.xml + + + WebSite with given name {0} already exists in the specified Subscription and Webspace. + + + WebSite with given name {0} already exists in the specified Subscription and Location. + + + Site {0} already has repository created for it. + + + Workspaces/WebsiteExtension/Website/{0}/dashboard/ + + + https://{0}/msdeploy.axd?site={1} + + + WorkerRole + + + setup_worker.cmd > log.txt + + + WorkerRole.xml + + + Yes + + + Yes, I agree + + + Remove-AzureTrafficManagerProfile Operation failed. + + + Successfully removed Traffic Manager profile with name {0}. + + + Are you sure you want to remove the Traffic Manager profile "{0}"? + + + Profile {0} already has an endpoint with name {1} + + + Profile {0} does not contain endpoint {1}. Adding it. + + + The endpoint {0} cannot be removed from profile {1} because it's not in the profile. + + + Insufficient parameters passed to create a new endpoint. + + + Ambiguous operation: the profile name specified doesn't match the name of the profile object. + + + <NONE> + + + "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}." + {0} is the HTTP status code. {1} is the Service Management Error Code. {2} is the Service Management Error message. {3} is the operation tracking ID. + + + Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}. + {0} is the string that is not in a valid base 64 format. + + + Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential". + + + Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'? + + + Removing environment + + + There is no subscription associated with account {0}. + + + Account id doesn't match one in subscription. + + + Environment name doesn't match one in subscription. + + + Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile? + + + Removing the Azure profile + + + The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. + + + Account needs to be specified + + + No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription. + + + Path must specify a valid path to an Azure profile. + + + Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token} + + + Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'. + + + Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'. + + + Property bag Hashtable must contain a 'SubscriptionId'. + + + Selected profile must not be null. + + + The Switch-AzureMode cmdlet is deprecated and will be removed in a future release. + + + OperationID : '{0}' + + + Cannot get module for DscResource '{0}'. Possible solutions: +1) Specify -ModuleName for Import-DscResource in your configuration. +2) Unblock module that contains resource. +3) Move Import-DscResource inside Node block. + + 0 = name of DscResource + + + Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version. + {0} = minimal required PS version, {1} = current PS version + + + Parsing configuration script: {0} + {0} is the path to a script file + + + Configuration script '{0}' contained parse errors: +{1} + 0 = path to the configuration script, 1 = parser errors + + + List of required modules: [{0}]. + {0} = list of modules + + + Temp folder '{0}' created. + {0} = temp folder path + + + Copy '{0}' to '{1}'. + {0} = source, {1} = destination + + + Copy the module '{0}' to '{1}'. + {0} = source, {1} = destination + + + File '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the path to a file + + + Configuration file '{0}' not found. + 0 = path to the configuration file + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip). + 0 = path to the configuration file + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1). + 0 = path to the configuration file + + + Create Archive + + + Upload '{0}' + {0} is the name of an storage blob + + + Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the name of an storage blob + + + Configuration published to {0} + {0} is an URI + + + Deleted '{0}' + {0} is the path of a file + + + Cannot delete '{0}': {1} + {0} is the path of a file, {1} is an error message + + + Cannot find the WadCfg end element in the config. + + + WadCfg start element in the config is not matching the end element. + + + Cannot find the WadCfg element in the config. + + + Cannot find configuration data file: {0} + + + The configuration data must be a .psd1 file + + + Cannot change built-in environment {0}. + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. +Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable data collection: PS > Enable-AzDataCollection. + + + Microsoft Azure PowerShell Data Collection Confirmation + + + You choose not to participate in Microsoft Azure PowerShell data collection. + + + This confirmation message will be dismissed in '{0}' second(s)... + + + You choose to participate in Microsoft Azure PowerShell data collection. + + + The setting profile has been saved to the following path '{0}'. + + + [Common.Authentication]: Authenticating for account {0} with single tenant {1}. + + + Changing public environment is not supported. + + + Environment name needs to be specified. + + + Environment needs to be specified. + + + The environment name '{0}' is not found. + + + File path is not valid. + + + Must specify a non-null subscription name. + + + The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription. + + + Removing public environment is not supported. + + + The subscription id {0} doesn't exist. + + + Subscription name needs to be specified. + + + The subscription name {0} doesn't exist. + + + Subscription needs to be specified. + + + User name is not valid. + + + User name needs to be specified. + + + "There is no current context, please log in using Connect-AzAccount." + + + No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount? + + + No certificate was found in the certificate store with thumbprint {0} + + + Illegal characters in path. + + + Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings + + + "{0}" is an invalid DNS name for {1} + + + The provided file in {0} must be have {1} extension + + + {0} is invalid or empty + + + Please connect to internet before executing this cmdlet + + + Path {0} doesn't exist. + + + Path for {0} doesn't exist in {1}. + + + &whr={0} + + + The provided service name {0} already exists, please pick another name + + + Unable to update mismatching Json structured: {0} {1}. + + + (x86) + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. +Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enable-AzureDataCollection. + + + Execution failed because a background thread could not prompt the user. + + + Azure Long-Running Job + + + The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter. + 0(string): exception message in background task + + + Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts. + + + Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter. + + + Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again. + + + Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter. + + + [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}' + 0(bool): whether cmdlet confirmation is required + + + [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}' + 0(string): method type + + + [AzureLongRunningJob]: Completing cmdlet execution in RunJob + + + [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}' + 0(string): last state, 1(string): new state, 2(string): state change reason + + + [AzureLongRunningJob]: Unblocking job due to stoppage or failure + + + [AzureLongRunningJob]: Unblocking job that was previously blocked. + + + [AzureLongRunningJob]: Error in cmdlet execution + + + [AzureLongRunningJob]: Removing state changed event handler, exception '{0}' + 0(string): exception message + + + [AzureLongRunningJob]: ShouldMethod '{0}' unblocked. + 0(string): methodType + + + +- The parameter : '{0}' is changing. + + + +- The parameter : '{0}' is becoming mandatory. + + + +- The parameter : '{0}' is being replaced by parameter : '{1}'. + + + +- The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. + + + +- Change description : {0} + + + The cmdlet is being deprecated. There will be no replacement for it. + + + The cmdlet parameter set is being deprecated. There will be no replacement for it. + + + The cmdlet '{0}' is replacing this cmdlet. + + + +- The output type is changing from the existing type :'{0}' to the new type :'{1}' + + + +- The output type '{0}' is changing + + + +- The following properties are being added to the output type : + + + +- The following properties in the output type are being deprecated : + + + {0} + + + +- Cmdlet : '{0}' + - {1} + + + Upcoming breaking changes in the cmdlet '{0}' : + + + +- This change will take effect on '{0}' + + + +- The change is expected to take effect from the version : '{0}' + + + ```powershell +# Old +{0} + +# New +{1} +``` + + + + +Cmdlet invocation changes : + Old Way : {0} + New Way : {1} + + + +The output type '{0}' is being deprecated without a replacement. + + + +The type of the parameter is changing from '{0}' to '{1}'. + + + +Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. + + + This cmdlet is in preview. The functionality may not be available in the selected subscription. + + \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Response.cs b/swaggerci/storSimple1200Series/generated/runtime/Response.cs new file mode 100644 index 000000000000..15382b813aa2 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Response.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + using System; + using System.Threading.Tasks; + public class Response : EventData + { + public Response() : base() + { + } + } + + public class Response : Response + { + private Func> _resultDelegate; + private Task _resultValue; + + public Response(T value) : base() => _resultValue = Task.FromResult(value); + public Response(Func value) : base() => _resultDelegate = () => Task.FromResult(value()); + public Response(Func> value) : base() => _resultDelegate = value; + public Task Result => _resultValue ?? (_resultValue = this._resultDelegate()); + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Serialization/JsonSerializer.cs b/swaggerci/storSimple1200Series/generated/runtime/Serialization/JsonSerializer.cs new file mode 100644 index 000000000000..0716946006d0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Serialization/JsonSerializer.cs @@ -0,0 +1,350 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal class JsonSerializer + { + private int depth = 0; + + private SerializationOptions options = new SerializationOptions(); + + #region Deserialization + + internal T Deseralize(JsonObject json) + where T : new() + { + var contract = JsonModelCache.Get(typeof(T)); + + return (T)DeserializeObject(contract, json); + } + + internal object DeserializeObject(JsonModel contract, JsonObject json) + { + var instance = Activator.CreateInstance(contract.Type); + + depth++; + + // Ensure we don't recurse forever + if (depth > 5) throw new Exception("Depth greater than 5"); + + foreach (var field in json) + { + var member = contract[field.Key]; + + if (member != null) + { + var value = DeserializeValue(member, field.Value); + + member.SetValue(instance, value); + } + } + + depth--; + + return instance; + } + + private object DeserializeValue(JsonMember member, JsonNode value) + { + if (value.Type == JsonType.Null) return null; + + var type = member.Type; + + if (member.IsStringLike && value.Type != JsonType.String) + { + // Take the long path... + return DeserializeObject(JsonModelCache.Get(type), (JsonObject)value); + } + else if (member.Converter != null) + { + return member.Converter.FromJson(value); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (member.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + private object DeserializeValue(Type type, JsonNode value) + { + if (type == null) throw new ArgumentNullException(nameof(type)); + + if (value.Type == JsonType.Null) return null; + + var typeDetails = TypeDetails.Get(type); + + if (typeDetails.JsonConverter != null) + { + return typeDetails.JsonConverter.FromJson(value); + } + else if (typeDetails.IsEnum) + { + return Enum.Parse(type, value.ToString(), ignoreCase: true); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (typeDetails.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + internal Array DeserializeArray(Type type, JsonArray elements) + { + var elementType = type.GetElementType(); + + var elementTypeDetails = TypeDetails.Get(elementType); + + var array = Array.CreateInstance(elementType, elements.Count); + + int i = 0; + + if (elementTypeDetails.JsonConverter != null) + { + foreach (var value in elements) + { + array.SetValue(elementTypeDetails.JsonConverter.FromJson(value), i); + + i++; + } + } + else + { + foreach (var value in elements) + { + array.SetValue(DeserializeValue(elementType, value), i); + + i++; + } + } + + return array; + } + + internal IList DeserializeList(Type type, JsonArray jsonArray) + { + // TODO: Handle non-generic types + if (!type.IsGenericType) + throw new ArgumentException("Must be a generic type", nameof(type)); + + var elementType = type.GetGenericArguments()[0]; + + IList list; + + if (type.IsInterface) + { + // Create a concrete generic list + list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(elementType)); + } + else + { + list = (IList)Activator.CreateInstance(type); + } + + foreach (var value in jsonArray) + { + list.Add(DeserializeValue(elementType, value)); + } + + return list; + } + + #endregion + + #region Serialization + + internal JsonNode Serialize(object instance) => + Serialize(instance, SerializationOptions.Default); + + internal JsonNode Serialize(object instance, string[] include) => + Serialize(instance, new SerializationOptions { Include = include }); + + internal JsonNode Serialize(object instance, SerializationOptions options) + { + this.options = options; + + if (instance == null) + { + return XNull.Instance; + } + + return ReadValue(instance.GetType(), instance); + } + + #region Readers + + internal JsonArray ReadArray(IEnumerable collection) + { + var array = new XNodeArray(); + + foreach (var item in collection) + { + array.Add(ReadValue(item.GetType(), item)); + } + + return array; + } + + internal IEnumerable> ReadProperties(object instance) + { + var contract = JsonModelCache.Get(instance.GetType()); + + foreach (var member in contract.Members) + { + string name = member.Name; + + if (options.PropertyNameTransformer != null) + { + name = options.PropertyNameTransformer.Invoke(name); + } + + // Skip the field if it's not included + if ((depth == 1 && !options.IsIncluded(name))) + { + continue; + } + + var value = member.GetValue(instance); + + if (!member.EmitDefaultValue && (value == null || (member.IsList && ((IList)value).Count == 0) || value.Equals(member.DefaultValue))) + { + continue; + } + else if (options.IgnoreNullValues && value == null) // Ignore null values + { + continue; + } + + // Transform the value if there is one + if (options.Transformations != null) + { + var transform = options.GetTransformation(name); + + if (transform != null) + { + value = transform.Transformer(value); + } + } + + yield return new KeyValuePair(name, ReadValue(member.TypeDetails, value)); + } + } + + private JsonObject ReadObject(object instance) + { + depth++; + + // TODO: Guard against a self referencing graph + if (depth > options.MaxDepth) + { + depth--; + + return new JsonObject(); + } + + var node = new JsonObject(ReadProperties(instance)); + + depth--; + + return node; + } + + private JsonNode ReadValue(Type type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + var member = TypeDetails.Get(type); + + return ReadValue(member, value); + } + + private JsonNode ReadValue(TypeDetails type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + if (type.JsonConverter != null) + { + return type.JsonConverter.ToJson(value); + } + else if (type.IsArray) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateArray((string[])value); + case TypeCode.UInt16: return CreateArray((ushort[])value); + case TypeCode.UInt32: return CreateArray((uint[])value); + case TypeCode.UInt64: return CreateArray((ulong[])value); + case TypeCode.Int16: return CreateArray((short[])value); + case TypeCode.Int32: return CreateArray((int[])value); + case TypeCode.Int64: return CreateArray((long[])value); + case TypeCode.Single: return CreateArray((float[])value); + case TypeCode.Double: return CreateArray((double[])value); + default: return ReadArray((IEnumerable)value); + } + } + else if (value is IEnumerable) + { + if (type.IsList && type.ElementType != null) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateList(value); + case TypeCode.UInt16: return CreateList(value); + case TypeCode.UInt32: return CreateList(value); + case TypeCode.UInt64: return CreateList(value); + case TypeCode.Int16: return CreateList(value); + case TypeCode.Int32: return CreateList(value); + case TypeCode.Int64: return CreateList(value); + case TypeCode.Single: return CreateList(value); + case TypeCode.Double: return CreateList(value); + } + } + + return ReadArray((IEnumerable)value); + } + else + { + // Complex object + return ReadObject(value); + } + } + + private XList CreateList(object value) => new XList((IList)value); + + private XImmutableArray CreateArray(T[] array) => new XImmutableArray(array); + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Serialization/PropertyTransformation.cs b/swaggerci/storSimple1200Series/generated/runtime/Serialization/PropertyTransformation.cs new file mode 100644 index 000000000000..6e74a329f3e1 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Serialization/PropertyTransformation.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal class PropertyTransformation + { + internal PropertyTransformation(string name, Func transformer) + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + Transformer = transformer ?? throw new ArgumentNullException(nameof(transformer)); + } + + internal string Name { get; } + + internal Func Transformer { get; } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Serialization/SerializationOptions.cs b/swaggerci/storSimple1200Series/generated/runtime/Serialization/SerializationOptions.cs new file mode 100644 index 000000000000..91f9d135db81 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Serialization/SerializationOptions.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal class SerializationOptions + { + internal static readonly SerializationOptions Default = new SerializationOptions(); + + internal SerializationOptions() { } + + internal SerializationOptions( + string[] include = null, + bool ingoreNullValues = false) + { + Include = include; + IgnoreNullValues = ingoreNullValues; + } + + internal string[] Include { get; set; } + + internal string[] Exclude { get; set; } + + internal bool IgnoreNullValues { get; set; } + + internal PropertyTransformation[] Transformations { get; set; } + + internal Func PropertyNameTransformer { get; set; } + + internal int MaxDepth { get; set; } = 5; + + internal bool IsIncluded(string name) + { + if (Exclude != null) + { + return !Exclude.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + else if (Include != null) + { + return Include.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + + return true; + } + + internal PropertyTransformation GetTransformation(string propertyName) + { + if (Transformations == null) return null; + + foreach (var t in Transformations) + { + if (t.Name.Equals(propertyName, StringComparison.OrdinalIgnoreCase)) + { + return t; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/SerializationMode.cs b/swaggerci/storSimple1200Series/generated/runtime/SerializationMode.cs new file mode 100644 index 000000000000..cd720d9aa8ca --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/SerializationMode.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + [System.Flags] + public enum SerializationMode + { + None = 0, + IncludeHeaders = 1 << 0, + IncludeReadOnly = 1 << 1, + + IncludeAll = IncludeHeaders | IncludeReadOnly + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/TypeConverterExtensions.cs b/swaggerci/storSimple1200Series/generated/runtime/TypeConverterExtensions.cs new file mode 100644 index 000000000000..04c1e56a0145 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/TypeConverterExtensions.cs @@ -0,0 +1,211 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Linq; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.PowerShell +{ + internal static class TypeConverterExtensions + { + internal static T[] SelectToArray(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }; + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0]; // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result.ToArray(); + } + + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Management.Automation.PSObject instance) + { + if (null != instance) + { + foreach (var each in instance.Properties) + { + yield return each; + } + } + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.Generic.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys.OfType() + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Management.Automation.PSObject instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + // new global::System.Collections.Generic.HashSet(System.StringComparer.InvariantCultureIgnoreCase) + return (null == instance || !instance.Properties.Any()) ? + Enumerable.Empty>() : + instance.Properties + .Where(property => + !(true == exclusions?.Contains(property.Name)) + && (false != inclusions?.Contains(property.Name))) + .Select(property => new System.Collections.Generic.KeyValuePair(property.Name, property.Value)); + } + + + internal static T GetValueForProperty(this System.Collections.Generic.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys, each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + internal static T GetValueForProperty(this System.Collections.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys.OfType(), each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static T GetValueForProperty(this System.Management.Automation.PSObject psObject, string propertyName, T defaultValue, System.Func converter) + { + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return property == null ? defaultValue : (T)converter(property.Value); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static bool Contains(this System.Management.Automation.PSObject psObject, string propertyName) + { + bool result = false; + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + result = property == null ? false : true; + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return result; + } + } +} diff --git a/swaggerci/storSimple1200Series/generated/runtime/UndeclaredResponseException.cs b/swaggerci/storSimple1200Series/generated/runtime/UndeclaredResponseException.cs new file mode 100644 index 000000000000..e7ba99083ebe --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/UndeclaredResponseException.cs @@ -0,0 +1,112 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + using System; + using System.Net.Http; + using System.Net.Http.Headers; + using static Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Extensions; + + public class RestException : Exception, IDisposable + { + public System.Net.HttpStatusCode StatusCode { get; set; } + public string Code { get; protected set; } + protected string message; + public HttpRequestMessage RequestMessage { get; protected set; } + public HttpResponseHeaders ResponseHeaders { get; protected set; } + + public string ResponseBody { get; protected set; } + public string ClientRequestId { get; protected set; } + public string RequestId { get; protected set; } + + public override string Message => message; + public string Action { get; protected set; } + + public RestException(System.Net.Http.HttpResponseMessage response) + { + StatusCode = response.StatusCode; + //CloneWithContent will not work here since the content is disposed after sendAsync + //Besides, it seems there is no need for the request content cloned here. + RequestMessage = response.RequestMessage.Clone(); + ResponseBody = response.Content.ReadAsStringAsync().Result; + ResponseHeaders = response.Headers; + + RequestId = response.GetFirstHeader("x-ms-request-id"); + ClientRequestId = response.GetFirstHeader("x-ms-client-request-id"); + + try + { + // try to parse the body as JSON, and see if a code and message are in there. + var json = Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonNode.Parse(ResponseBody) as Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json.JsonObject; + + // error message could be in properties.statusMessage + { message = If(json?.Property("properties"), out var p) + && If(p?.PropertyT("statusMessage"), out var sm) + ? (string)sm : (string)Message; } + + // see if there is an error block in the body + json = json?.Property("error") ?? json; + + { Code = If(json?.PropertyT("code"), out var c) ? (string)c : (string)StatusCode.ToString(); } + { message = If(json?.PropertyT("message"), out var m) ? (string)m : (string)Message; } + { Action = If(json?.PropertyT("action"), out var a) ? (string)a : (string)Action; } + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // couldn't get the code/message from the body response. + // In this case, we will assume the response is the expected error message + if(!string.IsNullOrEmpty(ResponseBody)) { + message = ResponseBody; + } + } +#endif + if (string.IsNullOrEmpty(message)) + { + if (StatusCode >= System.Net.HttpStatusCode.BadRequest && StatusCode < System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Request Error, Status: {StatusCode}"; + } + else if (StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Server Error, Status: {StatusCode}"; + } + else + { + message = $"The server responded with an unrecognized response, Status: {StatusCode}"; + } + } + } + + public void Dispose() + { + ((IDisposable)RequestMessage).Dispose(); + } + } + + public class RestException : RestException + { + public T Error { get; protected set; } + public RestException(System.Net.Http.HttpResponseMessage response, T error) : base(response) + { + Error = error; + } + } + + + public class UndeclaredResponseException : RestException + { + public UndeclaredResponseException(System.Net.Http.HttpResponseMessage response) : base(response) + { + + } + } +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/generated/runtime/Writers/JsonWriter.cs b/swaggerci/storSimple1200Series/generated/runtime/Writers/JsonWriter.cs new file mode 100644 index 000000000000..331752d71dc0 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/Writers/JsonWriter.cs @@ -0,0 +1,223 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Web; + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime.Json +{ + internal class JsonWriter + { + const string indentation = " "; // 2 spaces + + private readonly bool pretty; + private readonly TextWriter writer; + + protected int currentLevel = 0; + + internal JsonWriter(TextWriter writer, bool pretty = true) + { + this.writer = writer ?? throw new ArgumentNullException(nameof(writer)); + this.pretty = pretty; + } + + internal void WriteNode(JsonNode node) + { + switch (node.Type) + { + case JsonType.Array: WriteArray((IEnumerable)node); break; + case JsonType.Object: WriteObject((JsonObject)node); break; + + // Primitives + case JsonType.Binary: WriteBinary((XBinary)node); break; + case JsonType.Boolean: WriteBoolean((bool)node); break; + case JsonType.Date: WriteDate((JsonDate)node); break; + case JsonType.Null: WriteNull(); break; + case JsonType.Number: WriteNumber((JsonNumber)node); break; + case JsonType.String: WriteString(node); break; + } + } + + internal void WriteArray(IEnumerable array) + { + currentLevel++; + + writer.Write('['); + + bool doIndentation = false; + + if (pretty) + { + foreach (var node in array) + { + if (node.Type == JsonType.Object || node.Type == JsonType.Array) + { + doIndentation = true; + + break; + } + } + } + + bool isFirst = true; + + foreach (JsonNode node in array) + { + if (!isFirst) writer.Write(','); + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + WriteNode(node); + + isFirst = false; + } + + currentLevel--; + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + writer.Write(']'); + } + + internal void WriteIndent() + { + if (pretty) + { + writer.Write(Environment.NewLine); + + for (int level = 0; level < currentLevel; level++) + { + writer.Write(indentation); + } + } + } + + internal void WriteObject(JsonObject obj) + { + currentLevel++; + + writer.Write('{'); + + bool isFirst = true; + + foreach (var field in obj) + { + if (!isFirst) writer.Write(','); + + WriteIndent(); + + WriteFieldName(field.Key); + + writer.Write(':'); + + if (pretty) + { + writer.Write(' '); + } + + // Write the field value + WriteNode(field.Value); + + isFirst = false; + } + + currentLevel--; + + WriteIndent(); + + writer.Write('}'); + } + + internal void WriteFieldName(string fieldName) + { + writer.Write('"'); + writer.Write(HttpUtility.JavaScriptStringEncode(fieldName)); + writer.Write('"'); + } + + #region Primitives + + internal void WriteBinary(XBinary value) + { + writer.Write('"'); + writer.Write(value.ToString()); + writer.Write('"'); + } + + internal void WriteBoolean(bool value) + { + writer.Write(value ? "true" : "false"); + } + + internal void WriteDate(JsonDate date) + { + if (date.ToDateTime().Year == 1) + { + WriteNull(); + } + else + { + writer.Write('"'); + writer.Write(date.ToIsoString()); + writer.Write('"'); + } + } + + internal void WriteNull() + { + writer.Write("null"); + } + + internal void WriteNumber(JsonNumber number) + { + if (number.Overflows) + { + writer.Write('"'); + writer.Write(number.Value); + writer.Write('"'); + } + else + { + writer.Write(number.Value); + } + } + + internal void WriteString(string text) + { + if (text == null) + { + WriteNull(); + } + else + { + writer.Write('"'); + + writer.Write(HttpUtility.JavaScriptStringEncode(text)); + + writer.Write('"'); + } + } + + #endregion + } +} + + +// TODO: Replace with System.Text.Json when available diff --git a/swaggerci/storSimple1200Series/generated/runtime/delegates.cs b/swaggerci/storSimple1200Series/generated/runtime/delegates.cs new file mode 100644 index 000000000000..78dad122e6e6 --- /dev/null +++ b/swaggerci/storSimple1200Series/generated/runtime/delegates.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Runtime +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData=System.Func; + + public delegate Task SendAsync(HttpRequestMessage request, IEventListener callback); + public delegate Task SendAsyncStep(HttpRequestMessage request, IEventListener callback, ISendAsync next); + public delegate Task SignalEvent(string id, CancellationToken token, GetEventData getEventData); + public delegate Task Event(EventData message); + public delegate void SynchEvent(EventData message); + public delegate Task OnResponse(Response message); + public delegate Task OnResponse(Response message); +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/how-to.md b/swaggerci/storSimple1200Series/how-to.md new file mode 100644 index 000000000000..5cce78005927 --- /dev/null +++ b/swaggerci/storSimple1200Series/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.StorSimple`. + +## Building `Az.StorSimple` +To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [README.md](exports/README.md) in the `exports` folder. + +## Creating custom cmdlets +To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [README.md](custom/README.md) in the `custom` folder. + +## Generating documentation +To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [README.md](examples/README.md) in the `examples` folder. To read more about documentation, look at the [README.md](docs/README.md) in the `docs` folder. + +## Testing `Az.StorSimple` +To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder. + +## Packing `Az.StorSimple` +To pack `Az.StorSimple` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. + +## Module Script Details +There are multiple scripts created for performing different actions for developing `Az.StorSimple`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.StorSimple.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.StorSimple.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.StorSimple`. + - `-Test`: After building, runs the `Pester` tests defined in the `test` folder. + - `-Docs`: After building, generates the Markdown documents for the modules into the `docs` folder. + - `-Pack`: After building, packages the module into a `.nupkg`. + - `-Code`: After building, opens a VSCode window with the module's directory and runs (see `-Run`) the module. + - `-Release`: Builds the module in `Release` configuration (as opposed to `Debug` configuration). + - `-NoDocs`: Supresses writing the documentation markdown files as part of the cmdlet exporting process. + - `-Debugger`: Used when attaching the debugger in Visual Studio to the PowerShell session, and running the build process without recompiling the DLL. This suppresses running the script as an isolated process. +- `run-module.ps1` + - Creates an isolated PowerShell session and loads `Az.StorSimple` into the session. + - Same as `-Run` in `build-module.ps1`. + - **Parameters**: [`Switch` parameters] + - `-Code`: Opens a VSCode window with the module's directory. + - Same as `-Code` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. +- `test-module.ps1` + - Runs the `Pester` tests defined in the `test` folder. + - Same as `-Test` in `build-module.ps1`. +- `pack-module.ps1` + - Packages the module into a `.nupkg` for distribution. + - Same as `-Pack` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. + - This process is now integrated into `build-module.ps1` automatically. To disable, use `-NoDocs` when running `build-module.ps1`. +- `export-surface.ps1` + - Generates Markdown documents for both the cmdlet surface and the model (class) surface of the module. + - These files are placed into the `resources` folder. + - Used for investigating the surface of your module. These are *not* documentation for distribution. +- `check-dependencies.ps1` + - Used in `run-module.ps1` and `test-module.ps1` to verify dependent modules are available to run those tasks. + - It will download local (within the module's directory structure) versions of those modules as needed. + - This script *does not* need to be ran by-hand. \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/internal/Az.StorSimple.internal.psm1 b/swaggerci/storSimple1200Series/internal/Az.StorSimple.internal.psm1 new file mode 100644 index 000000000000..efeb6d18cafb --- /dev/null +++ b/swaggerci/storSimple1200Series/internal/Az.StorSimple.internal.psm1 @@ -0,0 +1,38 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.StorSimple.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.StorSimple.Module]::Instance + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = $PSScriptRoot + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } +# endregion diff --git a/swaggerci/storSimple1200Series/internal/README.md b/swaggerci/storSimple1200Series/internal/README.md new file mode 100644 index 000000000000..02e644eab5e6 --- /dev/null +++ b/swaggerci/storSimple1200Series/internal/README.md @@ -0,0 +1,14 @@ +# Internal +This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The `Az.StorSimple.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.StorSimple`. Instead, this sub-module is imported by the `../custom/Az.StorSimple.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.StorSimple.internal\Get-Example` would call an internal cmdlet named `Get-Example`. + +## Purpose +This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.StorSimple`. diff --git a/swaggerci/storSimple1200Series/license.txt b/swaggerci/storSimple1200Series/license.txt new file mode 100644 index 000000000000..b9f3180fb9af --- /dev/null +++ b/swaggerci/storSimple1200Series/license.txt @@ -0,0 +1,227 @@ +MICROSOFT SOFTWARE LICENSE TERMS + +MICROSOFT AZURE POWERSHELL + +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. + +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE. + + +-----------------START OF LICENSE-------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +-------------------END OF LICENSE------------------------------------------ + + +----------------START OF THIRD PARTY NOTICE-------------------------------- + + +The software includes the AutoMapper library ("AutoMapper"). The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Provided for Informational Purposes Only + +AutoMapper + +The MIT License (MIT) +Copyright (c) 2010 Jimmy Bogard + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + + + + +*************** + +The software includes Newtonsoft.Json. The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Newtonsoft.Json + +The MIT License (MIT) +Copyright (c) 2007 James Newton-King +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------END OF THIRD PARTY NOTICE---------------------------------------- + diff --git a/swaggerci/storSimple1200Series/pack-module.ps1 b/swaggerci/storSimple1200Series/pack-module.ps1 new file mode 100644 index 000000000000..8ed48957e579 --- /dev/null +++ b/swaggerci/storSimple1200Series/pack-module.ps1 @@ -0,0 +1,9 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +Write-Host -ForegroundColor Green 'Packing module...' +dotnet pack $PSScriptRoot --no-build /nologo +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/readme.md b/swaggerci/storSimple1200Series/readme.md new file mode 100644 index 000000000000..7823f905b84f --- /dev/null +++ b/swaggerci/storSimple1200Series/readme.md @@ -0,0 +1,10 @@ +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../../tools/SwaggerCI/readme.azure.noprofile.md + - $(this-folder)/../../../azure-rest-api-specs/specification/storSimple1200Series/resource-manager/readme.md +try-require: + - $(this-folder)/../../../azure-rest-api-specs/specification/storSimple1200Series/resource-manager/readme.powershell.md +``` diff --git a/swaggerci/storSimple1200Series/resources/README.md b/swaggerci/storSimple1200Series/resources/README.md new file mode 100644 index 000000000000..736492341e3d --- /dev/null +++ b/swaggerci/storSimple1200Series/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `../custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/run-module.ps1 b/swaggerci/storSimple1200Series/run-module.ps1 new file mode 100644 index 000000000000..b5b4b10f2290 --- /dev/null +++ b/swaggerci/storSimple1200Series/run-module.ps1 @@ -0,0 +1,54 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Code) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$isAzure = $true +if($isAzure) { + . (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts + # Load the latest version of Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.StorSimple.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +function Prompt { + Write-Host -NoNewline -ForegroundColor Green "PS $(Get-Location)" + Write-Host -NoNewline -ForegroundColor Gray ' [' + Write-Host -NoNewline -ForegroundColor White -BackgroundColor DarkCyan $moduleName + ']> ' +} + +# where we would find the launch.json file +$vscodeDirectory = New-Item -ItemType Directory -Force -Path (Join-Path $PSScriptRoot '.vscode') +$launchJson = Join-Path $vscodeDirectory 'launch.json' + +# if there is a launch.json file, let's just assume -Code, and update the file +if(($Code) -or (test-Path $launchJson) ) { + $launchContent = '{ "version": "0.2.0", "configurations":[{ "name":"Attach to PowerShell", "type":"coreclr", "request":"attach", "processId":"' + ([System.Diagnostics.Process]::GetCurrentProcess().Id) + '", "justMyCode":false }] }' + Set-Content -Path $launchJson -Value $launchContent + if($Code) { + # only launch vscode if they say -code + code $PSScriptRoot + } +} + +Import-Module -Name $modulePath \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/test-module.ps1 b/swaggerci/storSimple1200Series/test-module.ps1 new file mode 100644 index 000000000000..a08c693d4c53 --- /dev/null +++ b/swaggerci/storSimple1200Series/test-module.ps1 @@ -0,0 +1,86 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) +{ + Write-Host -ForegroundColor Green 'Creating isolated process...' + if ($PSBoundParameters.ContainsKey("TestName")) { + $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," + } + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +# This is a workaround, since for string array parameter, pwsh -File will only take the first element +if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and ($TestName[0].Contains(','))) { + $TestName = $TestName[0].Split(",") +} + +$ProgressPreference = 'SilentlyContinue' +$baseName = $PSScriptRoot.BaseName +$requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. ("$PSScriptRoot\test\utils.ps1") + +if ($requireResourceModule) +{ + # Load the latest Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version + $resourceModulePSD = Get-Item -Path (Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psd1') + Import-Module -Name $resourceModulePSD.FullName +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) +{ + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.StorSimple.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +Import-Module -Name Pester +Import-Module -Name $modulePath + +$TestMode = 'playback' +$ExcludeTag = @("LiveOnly") +if($Live) +{ + $TestMode = 'live' + $ExcludeTag = @() +} +if($Record) +{ + $TestMode = 'record' +} +try +{ + if ($TestMode -ne 'playback') + { + setupEnv + } + $testFolder = Join-Path $PSScriptRoot 'test' + if ($null -ne $TestName) + { + Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } else + { + Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } +} Finally +{ + if ($TestMode -ne 'playback') + { + cleanupEnv + } +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/test/Backup-AzStorSimpleFileServerNow.Tests.ps1 b/swaggerci/storSimple1200Series/test/Backup-AzStorSimpleFileServerNow.Tests.ps1 new file mode 100644 index 000000000000..0df45cabdddf --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Backup-AzStorSimpleFileServerNow.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Backup-AzStorSimpleFileServerNow')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Backup-AzStorSimpleFileServerNow.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Backup-AzStorSimpleFileServerNow' { + It 'Backup' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'BackupViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Backup-AzStorSimpleIscsiServerNow.Tests.ps1 b/swaggerci/storSimple1200Series/test/Backup-AzStorSimpleIscsiServerNow.Tests.ps1 new file mode 100644 index 000000000000..c5fcaf4ac4d1 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Backup-AzStorSimpleIscsiServerNow.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Backup-AzStorSimpleIscsiServerNow')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Backup-AzStorSimpleIscsiServerNow.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Backup-AzStorSimpleIscsiServerNow' { + It 'Backup' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'BackupViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Clear-AzStorSimpleAlert.Tests.ps1 b/swaggerci/storSimple1200Series/test/Clear-AzStorSimpleAlert.Tests.ps1 new file mode 100644 index 000000000000..f9eb68b87de7 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Clear-AzStorSimpleAlert.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Clear-AzStorSimpleAlert')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Clear-AzStorSimpleAlert.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Clear-AzStorSimpleAlert' { + It 'ClearExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Clear' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ClearViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ClearViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Copy-AzStorSimpleBackup.Tests.ps1 b/swaggerci/storSimple1200Series/test/Copy-AzStorSimpleBackup.Tests.ps1 new file mode 100644 index 000000000000..bb0e1aa4e735 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Copy-AzStorSimpleBackup.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Copy-AzStorSimpleBackup')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Copy-AzStorSimpleBackup.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Copy-AzStorSimpleBackup' { + It 'CloneExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Clone' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CloneViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CloneViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleAccessControlRecord.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleAccessControlRecord.Tests.ps1 new file mode 100644 index 000000000000..6ea7810a2d9f --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleAccessControlRecord.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleAccessControlRecord')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleAccessControlRecord.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleAccessControlRecord' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleAlert.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleAlert.Tests.ps1 new file mode 100644 index 000000000000..17adbdcff028 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleAlert.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleAlert')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleAlert.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleAlert' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleAvailableProviderOperation.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleAvailableProviderOperation.Tests.ps1 new file mode 100644 index 000000000000..9ad506a0a5e8 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleAvailableProviderOperation.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleAvailableProviderOperation')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleAvailableProviderOperation.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleAvailableProviderOperation' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleBackup.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleBackup.Tests.ps1 new file mode 100644 index 000000000000..965094081f41 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleBackup.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleBackup')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleBackup.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleBackup' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleBackupScheduleGroup.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleBackupScheduleGroup.Tests.ps1 new file mode 100644 index 000000000000..e60a3b2f5172 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleBackupScheduleGroup.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleBackupScheduleGroup')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleBackupScheduleGroup.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleBackupScheduleGroup' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleChapSetting.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleChapSetting.Tests.ps1 new file mode 100644 index 000000000000..6c9bf408b341 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleChapSetting.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleChapSetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleChapSetting.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleChapSetting' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDevice.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDevice.Tests.ps1 new file mode 100644 index 000000000000..24d4f18dc31f --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDevice.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleDevice')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleDevice.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleDevice' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceAlertSetting.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceAlertSetting.Tests.ps1 new file mode 100644 index 000000000000..356fae2aa14d --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceAlertSetting.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleDeviceAlertSetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleDeviceAlertSetting.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleDeviceAlertSetting' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceFailoverTarget.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceFailoverTarget.Tests.ps1 new file mode 100644 index 000000000000..7121a7a51fd6 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceFailoverTarget.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleDeviceFailoverTarget')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleDeviceFailoverTarget.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleDeviceFailoverTarget' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceMetric.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceMetric.Tests.ps1 new file mode 100644 index 000000000000..2814dedbf2cd --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceMetric.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleDeviceMetric')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleDeviceMetric.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleDeviceMetric' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceMetricDefinition.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceMetricDefinition.Tests.ps1 new file mode 100644 index 000000000000..0a9ad7aa2429 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceMetricDefinition.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleDeviceMetricDefinition')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleDeviceMetricDefinition.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleDeviceMetricDefinition' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceNetworkSetting.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceNetworkSetting.Tests.ps1 new file mode 100644 index 000000000000..6d4184f8d4b1 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceNetworkSetting.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleDeviceNetworkSetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleDeviceNetworkSetting.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleDeviceNetworkSetting' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceTimeSetting.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceTimeSetting.Tests.ps1 new file mode 100644 index 000000000000..8eda50517990 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceTimeSetting.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleDeviceTimeSetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleDeviceTimeSetting.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleDeviceTimeSetting' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceUpdateSummary.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceUpdateSummary.Tests.ps1 new file mode 100644 index 000000000000..3eb8027155f2 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleDeviceUpdateSummary.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleDeviceUpdateSummary')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleDeviceUpdateSummary.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleDeviceUpdateSummary' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileServer.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileServer.Tests.ps1 new file mode 100644 index 000000000000..a98c0f8a0366 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileServer.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleFileServer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleFileServer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleFileServer' { + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileServerMetric.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileServerMetric.Tests.ps1 new file mode 100644 index 000000000000..3c10ce49896d --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileServerMetric.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleFileServerMetric')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleFileServerMetric.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleFileServerMetric' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileServerMetricDefinition.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileServerMetricDefinition.Tests.ps1 new file mode 100644 index 000000000000..ef3c02f41a67 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileServerMetricDefinition.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleFileServerMetricDefinition')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleFileServerMetricDefinition.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleFileServerMetricDefinition' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileShare.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileShare.Tests.ps1 new file mode 100644 index 000000000000..fa1c42cb72ea --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileShare.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleFileShare')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleFileShare.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleFileShare' { + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileShareMetric.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileShareMetric.Tests.ps1 new file mode 100644 index 000000000000..3060c5f29de8 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileShareMetric.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleFileShareMetric')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleFileShareMetric.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleFileShareMetric' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileShareMetricDefinition.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileShareMetricDefinition.Tests.ps1 new file mode 100644 index 000000000000..49ca9b675033 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleFileShareMetricDefinition.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleFileShareMetricDefinition')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleFileShareMetricDefinition.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleFileShareMetricDefinition' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiDisk.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiDisk.Tests.ps1 new file mode 100644 index 000000000000..deec4fd3d631 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiDisk.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleIscsiDisk')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleIscsiDisk.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleIscsiDisk' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiDiskMetric.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiDiskMetric.Tests.ps1 new file mode 100644 index 000000000000..149ce6fdf797 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiDiskMetric.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleIscsiDiskMetric')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleIscsiDiskMetric.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleIscsiDiskMetric' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiDiskMetricDefinition.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiDiskMetricDefinition.Tests.ps1 new file mode 100644 index 000000000000..d138cb44cb41 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiDiskMetricDefinition.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleIscsiDiskMetricDefinition')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleIscsiDiskMetricDefinition.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleIscsiDiskMetricDefinition' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiServer.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiServer.Tests.ps1 new file mode 100644 index 000000000000..548788582d8d --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiServer.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleIscsiServer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleIscsiServer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleIscsiServer' { + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiServerMetric.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiServerMetric.Tests.ps1 new file mode 100644 index 000000000000..92dbc885213a --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiServerMetric.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleIscsiServerMetric')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleIscsiServerMetric.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleIscsiServerMetric' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiServerMetricDefinition.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiServerMetricDefinition.Tests.ps1 new file mode 100644 index 000000000000..8cd0c7f36932 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleIscsiServerMetricDefinition.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleIscsiServerMetricDefinition')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleIscsiServerMetricDefinition.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleIscsiServerMetricDefinition' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleJob.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleJob.Tests.ps1 new file mode 100644 index 000000000000..dbd1bebefc22 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleJob.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleJob')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleJob.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleJob' { + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManager.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManager.Tests.ps1 new file mode 100644 index 000000000000..ba6ca1aa7b5c --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManager.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleManager')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleManager.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleManager' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerEncryptionKey.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerEncryptionKey.Tests.ps1 new file mode 100644 index 000000000000..b20a4b53ddae --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerEncryptionKey.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleManagerEncryptionKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleManagerEncryptionKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleManagerEncryptionKey' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerEncryptionSetting.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerEncryptionSetting.Tests.ps1 new file mode 100644 index 000000000000..e87c13385448 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerEncryptionSetting.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleManagerEncryptionSetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleManagerEncryptionSetting.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleManagerEncryptionSetting' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerExtendedInfo.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerExtendedInfo.Tests.ps1 new file mode 100644 index 000000000000..3a6f688f465b --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerExtendedInfo.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleManagerExtendedInfo')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleManagerExtendedInfo.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleManagerExtendedInfo' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerMetric.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerMetric.Tests.ps1 new file mode 100644 index 000000000000..c1e6917d4014 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerMetric.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleManagerMetric')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleManagerMetric.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleManagerMetric' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerMetricDefinition.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerMetricDefinition.Tests.ps1 new file mode 100644 index 000000000000..9802117ecdd6 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleManagerMetricDefinition.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleManagerMetricDefinition')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleManagerMetricDefinition.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleManagerMetricDefinition' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleStorageAccountCredentials.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleStorageAccountCredentials.Tests.ps1 new file mode 100644 index 000000000000..0c55344fafab --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleStorageAccountCredentials.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleStorageAccountCredentials')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleStorageAccountCredentials.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleStorageAccountCredentials' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Get-AzStorSimpleStorageDomain.Tests.ps1 b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleStorageDomain.Tests.ps1 new file mode 100644 index 000000000000..049938d48a7a --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Get-AzStorSimpleStorageDomain.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorSimpleStorageDomain')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorSimpleStorageDomain.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorSimpleStorageDomain' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Install-AzStorSimpleDeviceUpdate.Tests.ps1 b/swaggerci/storSimple1200Series/test/Install-AzStorSimpleDeviceUpdate.Tests.ps1 new file mode 100644 index 000000000000..0b5869babbc2 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Install-AzStorSimpleDeviceUpdate.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Install-AzStorSimpleDeviceUpdate')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Install-AzStorSimpleDeviceUpdate.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Install-AzStorSimpleDeviceUpdate' { + It 'Install' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'InstallViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Invoke-AzStorSimpleDeactivateDevice.Tests.ps1 b/swaggerci/storSimple1200Series/test/Invoke-AzStorSimpleDeactivateDevice.Tests.ps1 new file mode 100644 index 000000000000..948484a0122f --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Invoke-AzStorSimpleDeactivateDevice.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzStorSimpleDeactivateDevice')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzStorSimpleDeactivateDevice.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzStorSimpleDeactivateDevice' { + It 'Deactivate' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeactivateViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Invoke-AzStorSimpleDownloadDeviceUpdate.Tests.ps1 b/swaggerci/storSimple1200Series/test/Invoke-AzStorSimpleDownloadDeviceUpdate.Tests.ps1 new file mode 100644 index 000000000000..8c0ab660a74a --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Invoke-AzStorSimpleDownloadDeviceUpdate.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzStorSimpleDownloadDeviceUpdate')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzStorSimpleDownloadDeviceUpdate.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzStorSimpleDownloadDeviceUpdate' { + It 'Download' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DownloadViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Invoke-AzStorSimpleScanDevice.Tests.ps1 b/swaggerci/storSimple1200Series/test/Invoke-AzStorSimpleScanDevice.Tests.ps1 new file mode 100644 index 000000000000..7e4d91cc6758 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Invoke-AzStorSimpleScanDevice.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzStorSimpleScanDevice')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzStorSimpleScanDevice.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzStorSimpleScanDevice' { + It 'Scan' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ScanViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Invoke-AzStorSimpleUploadManagerRegistrationCertificate.Tests.ps1 b/swaggerci/storSimple1200Series/test/Invoke-AzStorSimpleUploadManagerRegistrationCertificate.Tests.ps1 new file mode 100644 index 000000000000..87b355a5bd5b --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Invoke-AzStorSimpleUploadManagerRegistrationCertificate.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzStorSimpleUploadManagerRegistrationCertificate')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzStorSimpleUploadManagerRegistrationCertificate.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzStorSimpleUploadManagerRegistrationCertificate' { + It 'UploadExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Upload' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UploadViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UploadViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/New-AzStorSimpleAccessControlRecord.Tests.ps1 b/swaggerci/storSimple1200Series/test/New-AzStorSimpleAccessControlRecord.Tests.ps1 new file mode 100644 index 000000000000..269186080332 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/New-AzStorSimpleAccessControlRecord.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorSimpleAccessControlRecord')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorSimpleAccessControlRecord.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorSimpleAccessControlRecord' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/New-AzStorSimpleBackupScheduleGroup.Tests.ps1 b/swaggerci/storSimple1200Series/test/New-AzStorSimpleBackupScheduleGroup.Tests.ps1 new file mode 100644 index 000000000000..792aa9ac9b4a --- /dev/null +++ b/swaggerci/storSimple1200Series/test/New-AzStorSimpleBackupScheduleGroup.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorSimpleBackupScheduleGroup')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorSimpleBackupScheduleGroup.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorSimpleBackupScheduleGroup' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/New-AzStorSimpleChapSetting.Tests.ps1 b/swaggerci/storSimple1200Series/test/New-AzStorSimpleChapSetting.Tests.ps1 new file mode 100644 index 000000000000..3ee74aa53e32 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/New-AzStorSimpleChapSetting.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorSimpleChapSetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorSimpleChapSetting.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorSimpleChapSetting' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/New-AzStorSimpleDeviceAlertSetting.Tests.ps1 b/swaggerci/storSimple1200Series/test/New-AzStorSimpleDeviceAlertSetting.Tests.ps1 new file mode 100644 index 000000000000..dbbcfca6c789 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/New-AzStorSimpleDeviceAlertSetting.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorSimpleDeviceAlertSetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorSimpleDeviceAlertSetting.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorSimpleDeviceAlertSetting' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/New-AzStorSimpleDeviceSecuritySetting.Tests.ps1 b/swaggerci/storSimple1200Series/test/New-AzStorSimpleDeviceSecuritySetting.Tests.ps1 new file mode 100644 index 000000000000..0e70f24c72e0 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/New-AzStorSimpleDeviceSecuritySetting.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorSimpleDeviceSecuritySetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorSimpleDeviceSecuritySetting.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorSimpleDeviceSecuritySetting' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/New-AzStorSimpleFileServer.Tests.ps1 b/swaggerci/storSimple1200Series/test/New-AzStorSimpleFileServer.Tests.ps1 new file mode 100644 index 000000000000..136fad7f4be3 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/New-AzStorSimpleFileServer.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorSimpleFileServer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorSimpleFileServer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorSimpleFileServer' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/New-AzStorSimpleFileShare.Tests.ps1 b/swaggerci/storSimple1200Series/test/New-AzStorSimpleFileShare.Tests.ps1 new file mode 100644 index 000000000000..3bb2f828ba09 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/New-AzStorSimpleFileShare.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorSimpleFileShare')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorSimpleFileShare.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorSimpleFileShare' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/New-AzStorSimpleIscsiDisk.Tests.ps1 b/swaggerci/storSimple1200Series/test/New-AzStorSimpleIscsiDisk.Tests.ps1 new file mode 100644 index 000000000000..a976b6fcb8a1 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/New-AzStorSimpleIscsiDisk.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorSimpleIscsiDisk')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorSimpleIscsiDisk.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorSimpleIscsiDisk' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/New-AzStorSimpleIscsiServer.Tests.ps1 b/swaggerci/storSimple1200Series/test/New-AzStorSimpleIscsiServer.Tests.ps1 new file mode 100644 index 000000000000..f5497c54d2ed --- /dev/null +++ b/swaggerci/storSimple1200Series/test/New-AzStorSimpleIscsiServer.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorSimpleIscsiServer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorSimpleIscsiServer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorSimpleIscsiServer' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/New-AzStorSimpleManager.Tests.ps1 b/swaggerci/storSimple1200Series/test/New-AzStorSimpleManager.Tests.ps1 new file mode 100644 index 000000000000..0a385d06aa75 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/New-AzStorSimpleManager.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorSimpleManager')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorSimpleManager.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorSimpleManager' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/New-AzStorSimpleManagerExtendedInfo.Tests.ps1 b/swaggerci/storSimple1200Series/test/New-AzStorSimpleManagerExtendedInfo.Tests.ps1 new file mode 100644 index 000000000000..3a2c9f851c8e --- /dev/null +++ b/swaggerci/storSimple1200Series/test/New-AzStorSimpleManagerExtendedInfo.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorSimpleManagerExtendedInfo')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorSimpleManagerExtendedInfo.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorSimpleManagerExtendedInfo' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/New-AzStorSimpleStorageAccountCredentials.Tests.ps1 b/swaggerci/storSimple1200Series/test/New-AzStorSimpleStorageAccountCredentials.Tests.ps1 new file mode 100644 index 000000000000..d8352b9b154b --- /dev/null +++ b/swaggerci/storSimple1200Series/test/New-AzStorSimpleStorageAccountCredentials.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorSimpleStorageAccountCredentials')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorSimpleStorageAccountCredentials.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorSimpleStorageAccountCredentials' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/New-AzStorSimpleStorageDomain.Tests.ps1 b/swaggerci/storSimple1200Series/test/New-AzStorSimpleStorageDomain.Tests.ps1 new file mode 100644 index 000000000000..c01242e6bca1 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/New-AzStorSimpleStorageDomain.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorSimpleStorageDomain')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorSimpleStorageDomain.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorSimpleStorageDomain' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/README.md b/swaggerci/storSimple1200Series/test/README.md new file mode 100644 index 000000000000..1969200c6a09 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/README.md @@ -0,0 +1,17 @@ +# Test +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `../custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Details +We allow three testing modes: *live*, *record*, and *playback*. These can be selected using the `-Live`, `-Record`, and `-Playback` switches respectively on the `test-module.ps1` script. This script will run through any `.Tests.ps1` scripts in the `test` folder. If you choose the *record* mode, it will create a `.Recording.json` file of the REST calls between the client and server. Then, when you choose *playback* mode, it will use the `.Recording.json` file to mock the communication between server and client. The *live* mode runs the same as the *record* mode; however, it doesn't create the `.Recording.json` file. + +## Purpose +Custom cmdlets generally encompass additional functionality not described in the REST specification, or combines functionality generated from the REST spec. To validate this functionality continues to operate as intended, creating tests that can be ran and re-ran against custom cmdlets is part of the framework. + +## Usage +To execute tests, run the `test-module.ps1`. To write tests, [this example](https://github.com/pester/Pester/blob/8b9cf4248315e44f1ac6673be149f7e0d7f10466/Examples/Planets/Get-Planet.Tests.ps1#L1) from the Pester repository is very useful for getting started. \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleAccessControlRecord.Tests.ps1 b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleAccessControlRecord.Tests.ps1 new file mode 100644 index 000000000000..6b49424a79f2 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleAccessControlRecord.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorSimpleAccessControlRecord')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorSimpleAccessControlRecord.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorSimpleAccessControlRecord' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleBackup.Tests.ps1 b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleBackup.Tests.ps1 new file mode 100644 index 000000000000..a198e90b05a4 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleBackup.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorSimpleBackup')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorSimpleBackup.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorSimpleBackup' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleBackupScheduleGroup.Tests.ps1 b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleBackupScheduleGroup.Tests.ps1 new file mode 100644 index 000000000000..f5ae1e59c6ac --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleBackupScheduleGroup.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorSimpleBackupScheduleGroup')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorSimpleBackupScheduleGroup.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorSimpleBackupScheduleGroup' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleChapSetting.Tests.ps1 b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleChapSetting.Tests.ps1 new file mode 100644 index 000000000000..afcc44f77db1 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleChapSetting.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorSimpleChapSetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorSimpleChapSetting.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorSimpleChapSetting' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleDevice.Tests.ps1 b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleDevice.Tests.ps1 new file mode 100644 index 000000000000..cc9e44565c3c --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleDevice.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorSimpleDevice')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorSimpleDevice.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorSimpleDevice' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleFileServer.Tests.ps1 b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleFileServer.Tests.ps1 new file mode 100644 index 000000000000..9a17e61922c3 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleFileServer.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorSimpleFileServer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorSimpleFileServer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorSimpleFileServer' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleFileShare.Tests.ps1 b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleFileShare.Tests.ps1 new file mode 100644 index 000000000000..50aeeb1d69bf --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleFileShare.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorSimpleFileShare')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorSimpleFileShare.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorSimpleFileShare' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleIscsiDisk.Tests.ps1 b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleIscsiDisk.Tests.ps1 new file mode 100644 index 000000000000..0bdd39acdd00 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleIscsiDisk.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorSimpleIscsiDisk')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorSimpleIscsiDisk.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorSimpleIscsiDisk' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleIscsiServer.Tests.ps1 b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleIscsiServer.Tests.ps1 new file mode 100644 index 000000000000..6e8c36bcf1ad --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleIscsiServer.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorSimpleIscsiServer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorSimpleIscsiServer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorSimpleIscsiServer' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleManager.Tests.ps1 b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleManager.Tests.ps1 new file mode 100644 index 000000000000..3732257afa3b --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleManager.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorSimpleManager')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorSimpleManager.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorSimpleManager' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleManagerExtendedInfo.Tests.ps1 b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleManagerExtendedInfo.Tests.ps1 new file mode 100644 index 000000000000..e6b0d2fdb1b3 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleManagerExtendedInfo.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorSimpleManagerExtendedInfo')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorSimpleManagerExtendedInfo.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorSimpleManagerExtendedInfo' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleStorageAccountCredentials.Tests.ps1 b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleStorageAccountCredentials.Tests.ps1 new file mode 100644 index 000000000000..18ce72183e3d --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleStorageAccountCredentials.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorSimpleStorageAccountCredentials')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorSimpleStorageAccountCredentials.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorSimpleStorageAccountCredentials' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleStorageDomain.Tests.ps1 b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleStorageDomain.Tests.ps1 new file mode 100644 index 000000000000..7182360255d8 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Remove-AzStorSimpleStorageDomain.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorSimpleStorageDomain')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorSimpleStorageDomain.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorSimpleStorageDomain' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Send-AzStorSimpleAlertTestEmail.Tests.ps1 b/swaggerci/storSimple1200Series/test/Send-AzStorSimpleAlertTestEmail.Tests.ps1 new file mode 100644 index 000000000000..1e9455733edf --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Send-AzStorSimpleAlertTestEmail.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Send-AzStorSimpleAlertTestEmail')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Send-AzStorSimpleAlertTestEmail.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Send-AzStorSimpleAlertTestEmail' { + It 'SendExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Send' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'SendViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'SendViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Update-AzStorSimpleDevice.Tests.ps1 b/swaggerci/storSimple1200Series/test/Update-AzStorSimpleDevice.Tests.ps1 new file mode 100644 index 000000000000..0c09db459be2 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Update-AzStorSimpleDevice.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzStorSimpleDevice')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzStorSimpleDevice.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzStorSimpleDevice' { + It 'PatchExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Patch' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'PatchViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'PatchViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Update-AzStorSimpleDeviceSecuritySetting.Tests.ps1 b/swaggerci/storSimple1200Series/test/Update-AzStorSimpleDeviceSecuritySetting.Tests.ps1 new file mode 100644 index 000000000000..68d945313043 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Update-AzStorSimpleDeviceSecuritySetting.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzStorSimpleDeviceSecuritySetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzStorSimpleDeviceSecuritySetting.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzStorSimpleDeviceSecuritySetting' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Update-AzStorSimpleManager.Tests.ps1 b/swaggerci/storSimple1200Series/test/Update-AzStorSimpleManager.Tests.ps1 new file mode 100644 index 000000000000..da2156bbfd56 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Update-AzStorSimpleManager.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzStorSimpleManager')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzStorSimpleManager.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzStorSimpleManager' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/Update-AzStorSimpleManagerExtendedInfo.Tests.ps1 b/swaggerci/storSimple1200Series/test/Update-AzStorSimpleManagerExtendedInfo.Tests.ps1 new file mode 100644 index 000000000000..5af456cee18b --- /dev/null +++ b/swaggerci/storSimple1200Series/test/Update-AzStorSimpleManagerExtendedInfo.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzStorSimpleManagerExtendedInfo')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzStorSimpleManagerExtendedInfo.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzStorSimpleManagerExtendedInfo' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storSimple1200Series/test/loadEnv.ps1 b/swaggerci/storSimple1200Series/test/loadEnv.ps1 new file mode 100644 index 000000000000..0ea394729062 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/loadEnv.ps1 @@ -0,0 +1,21 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json + $PSDefaultParameterValues=@{"*:SubscriptionId"=$env.SubscriptionId; "*:Tenant"=$env.Tenant} +} \ No newline at end of file diff --git a/swaggerci/storSimple1200Series/test/utils.ps1 b/swaggerci/storSimple1200Series/test/utils.ps1 new file mode 100644 index 000000000000..1990edd45299 --- /dev/null +++ b/swaggerci/storSimple1200Series/test/utils.ps1 @@ -0,0 +1,31 @@ +function RandomString([bool]$allChars, [int32]$len) { + if ($allChars) { + return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) + } else { + return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} + diff --git a/swaggerci/storSimple1200Series/utils/Unprotect-SecureString.ps1 b/swaggerci/storSimple1200Series/utils/Unprotect-SecureString.ps1 new file mode 100644 index 000000000000..cb05b51a6220 --- /dev/null +++ b/swaggerci/storSimple1200Series/utils/Unprotect-SecureString.ps1 @@ -0,0 +1,16 @@ +#This script converts securestring to plaintext + +param( + [Parameter(Mandatory, ValueFromPipeline)] + [System.Security.SecureString] + ${SecureString} +) + +$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString) +try { + $plaintext = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr) +} finally { + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr) +} + +return $plaintext \ No newline at end of file